patch-2.1.53 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.52/linux/net/ipv4/ip_sockglue.c linux/net/ipv4/ip_sockglue.c
@@ -261,7 +261,16 @@
 				return -EINVAL;
 			if (IPTOS_PREC(val) >= IPTOS_PREC_CRITIC_ECP && !suser())
 				return -EPERM;
-			sk->ip_tos=val;
+			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();
+			}
 			sk->priority = rt_tos2priority(val);
 			return 0;
 		case IP_TTL:

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