patch-2.1.89 linux/net/ipv4/ip_sockglue.c

Next file: linux/net/ipv4/ipip.c
Previous file: linux/net/ipv4/ip_output.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.88/linux/net/ipv4/ip_sockglue.c linux/net/ipv4/ip_sockglue.c
@@ -14,6 +14,7 @@
  *		Martin Mares	:	TOS setting fixed.
  *		Alan Cox	:	Fixed a couple of oopses in Martin's 
  *					TOS tweaks.
+ *		Mike McLagan	:	Routing by source
  */
 
 #include <linux/config.h>
@@ -313,14 +314,9 @@
 			if (IPTOS_PREC(val) >= IPTOS_PREC_CRITIC_ECP && !suser())
 				return -EPERM;
 			if (sk->ip_tos != val) {
-				start_bh_atomic(); 
 				sk->ip_tos=val;
 				sk->priority = rt_tos2priority(val);
-				if (sk->dst_cache) {
-					dst_release(sk->dst_cache); 
-					sk->dst_cache = NULL;
-				}
-				end_bh_atomic();
+				dst_release(xchg(&sk->dst_cache, NULL)); 
 			}
 			sk->priority = rt_tos2priority(val);
 			return 0;

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov