patch-1.3.30 linux/net/ipv4/raw.c

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

diff -u --recursive --new-file v1.3.29/linux/net/ipv4/raw.c linux/net/ipv4/raw.c
@@ -220,9 +220,17 @@
 		return -EACCES;
 
 	if(sk->ip_hdrincl)
-		err=ip_build_xmit(sk, raw_getrawfrag, from, len, sin.sin_addr.s_addr, flags, sin.sin_port);
+	{
+		if(len>65535)
+			return -EMSGSIZE;
+		err=ip_build_xmit(sk, raw_getrawfrag, from, len, sin.sin_addr.s_addr, 0, sk->opt, flags, sin.sin_port);
+	}
 	else
-		err=ip_build_xmit(sk, raw_getfrag, from, len, sin.sin_addr.s_addr, flags, sin.sin_port);
+	{
+		if(len>65535-sizeof(struct iphdr))
+			return -EMSGSIZE;
+		err=ip_build_xmit(sk, raw_getfrag, from, len, sin.sin_addr.s_addr, 0, sk->opt, flags, sin.sin_port);
+	}
 	return err<0?err:len;
 }
 

FUNET's LINUX-ADM group, [email protected]
TCL-scripts by Sam Shen, [email protected] with Sam's (original) version
of this