patch-1.3.91 linux/net/ipv4/ip_options.c

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

diff -u --recursive --new-file v1.3.90/linux/net/ipv4/ip_options.c linux/net/ipv4/ip_options.c
@@ -277,7 +277,7 @@
 		if (optlen<2 || optlen>l)
 		{
 			pp_ptr = optptr;
-			break;
+			goto error;
 		}
 		switch (*optptr) 
 		{
@@ -286,25 +286,25 @@
 			if (optlen < 3) 
 			{
 				pp_ptr = optptr + 1;
-				break;
+				goto error;
 			}
 			if (optptr[2] < 4) 
 			{
 				pp_ptr = optptr + 2;
-				break;
+				goto error;
 			}
 			/* NB: cf RFC-1812 5.2.4.1 */
 			if (opt->srr) 
 			{
 				pp_ptr = optptr;
-				break;
+				goto error;
 			}
 			if (!skb) 
 			{
 				if (optptr[2] != 4 || optlen < 7 || ((optlen-3) & 3)) 
 				{
 					pp_ptr = optptr + 1;
-					break;
+					goto error;
 				}
 				memcpy(&opt->faddr, &optptr[3], 4);
 				if (optlen > 7)
@@ -317,24 +317,24 @@
 			if (opt->rr) 
 			{
 				pp_ptr = optptr;
-				break;
+				goto error;
 			}
 			if (optlen < 3) 
 			{
 				pp_ptr = optptr + 1;
-				break;
+				goto error;
 			}
 			if (optptr[2] < 4) 
 			{
 				pp_ptr = optptr + 2;
-				break;
+				goto error;
 			}
 			if (optptr[2] <= optlen) 
 			{
 				if (optptr[2]+3 > optlen) 
 				{
 					pp_ptr = optptr + 2;
-					break;
+					goto error;
 				}
 				if (skb) 
 				{
@@ -350,17 +350,17 @@
 			if (opt->ts) 
 			{
 				pp_ptr = optptr;
-				break;
+				goto error;
 			}
 			if (optlen < 4) 
 			{
 				pp_ptr = optptr + 1;
-				break;
+				goto error;
 			}
 			if (optptr[2] < 5) 
 			{
 				pp_ptr = optptr + 2;
-				break;
+				goto error;
 			}
 			if (optptr[2] <= optlen) 
 			{
@@ -369,7 +369,7 @@
 				if (ts->ptr+3 > ts->len) 
 				{
 					pp_ptr = optptr + 2;
-					break;
+					goto error;
 				}
 				switch (ts->flags) 
 				{
@@ -384,7 +384,7 @@
 					if (ts->ptr+7 > ts->len) 
 					{
 						pp_ptr = optptr + 2;
-						break;
+						goto error;
 					}
 					opt->ts = optptr - iph;
 					if (skb) 
@@ -400,7 +400,7 @@
 					if (ts->ptr+7 > ts->len) 
 					{
 						pp_ptr = optptr + 2;
-						break;
+						goto error;
 					}
 					opt->ts = optptr - iph;
 					{
@@ -417,7 +417,7 @@
 					break;
 				      default:
 					pp_ptr = optptr + 3;
-					break;
+					goto error;
 				}
 				if (timeptr) 
 				{
@@ -435,7 +435,7 @@
 				if (ts->overflow == 15) 
 				{
 					pp_ptr = optptr + 3;
-					break;
+					goto error;
 				}
 				opt->ts = optptr - iph;
 				if (skb) 
@@ -451,7 +451,7 @@
 			if (!skb) 
 			{
 				pp_ptr = optptr;
-				break;
+				goto error;
 			}
 			break;
 		}
@@ -463,6 +463,7 @@
 	if (!pp_ptr)
 		return 0;
 
+error:
 	if (skb) 
 	{
 		icmp_send(skb, ICMP_PARAMETERPROB, 0, pp_ptr-iph, skb->dev);

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov with Sam's (original) version
of this