patch-2.4.0-test3 linux/net/ipv4/ip_sockglue.c

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

diff -u --recursive --new-file v2.4.0-test2/linux/net/ipv4/ip_sockglue.c linux/net/ipv4/ip_sockglue.c
@@ -5,7 +5,7 @@
  *
  *		The IP to API glue.
  *		
- * Version:	$Id: ip_sockglue.c,v 1.47 2000/01/16 05:11:23 davem Exp $
+ * Version:	$Id: ip_sockglue.c,v 1.49 2000/07/08 00:20:43 davem Exp $
  *
  * Authors:	see ip.c
  *
@@ -327,6 +327,8 @@
 	if (err)
 		goto out_free_skb;
 
+	sock_recv_timestamp(msg, sk, skb);
+
 	serr = SKB_EXT_ERR(skb);
 
 	sin = (struct sockaddr_in *)msg->msg_name;
@@ -462,8 +464,15 @@
 			break;
 		case IP_TOS:	/* This sets both TOS and Precedence */
 			  /* Reject setting of unused bits */
+#ifndef CONFIG_INET_ECN
 			if (val & ~(IPTOS_TOS_MASK|IPTOS_PREC_MASK))
 				goto e_inval;
+#else
+			if (sk->type == SOCK_STREAM) {
+				val &= ~3;
+				val |= sk->protinfo.af_inet.tos & 3;
+			}
+#endif
 			if (IPTOS_PREC(val) >= IPTOS_PREC_CRITIC_ECP && 
 			    !capable(CAP_NET_ADMIN)) {
 				err = -EPERM;

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)