Netdev List
 help / color / mirror / Atom feed
* regression: Apparently missing err assignment in ipv6 bind
@ 2009-08-27 15:16 Maciej Żenczykowski
  2009-08-27 20:12 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Maciej Żenczykowski @ 2009-08-27 15:16 UTC (permalink / raw)
  To: David S. Miller; +Cc: netdev

[-- Attachment #1: Type: text/plain, Size: 266 bytes --]

AFAICT, 2.6.30.5 and 2.6.31-rc7 both include a change in net/ipv6/af_inet6.c

http://lxr.linux.no/linux+v2.6.30.5/net/ipv6/af_inet6.c#L298

which results in a possible error return path with no err assignment.
I believe the error should be EADDRNOTAVAIL.

-- Maciej

[-- Attachment #2: bindv6err-2.6.30.5.patch --]
[-- Type: text/x-patch, Size: 492 bytes --]

--- linux-2.6.30.5/net/ipv6/af_inet6.c_	2009-06-09 20:05:27.000000000 -0700
+++ linux-2.6.30.5/net/ipv6/af_inet6.c	2009-08-27 08:05:37.000000000 -0700
@@ -294,8 +294,10 @@
 		    v4addr != htonl(INADDR_ANY) &&
 		    chk_addr_ret != RTN_LOCAL &&
 		    chk_addr_ret != RTN_MULTICAST &&
-		    chk_addr_ret != RTN_BROADCAST)
+		    chk_addr_ret != RTN_BROADCAST) {
+			err = -EADDRNOTAVAIL;
 			goto out;
+		}
 	} else {
 		if (addr_type != IPV6_ADDR_ANY) {
 			struct net_device *dev = NULL;

[-- Attachment #3: bindv6err-2.6.31-rc7.patch --]
[-- Type: text/x-patch, Size: 496 bytes --]

--- linux-2.6.31-rc7/net/ipv6/af_inet6.c_	2009-08-27 08:02:22.000000000 -0700
+++ linux-2.6.31-rc7/net/ipv6/af_inet6.c	2009-08-27 08:07:16.000000000 -0700
@@ -306,8 +306,10 @@
 		    v4addr != htonl(INADDR_ANY) &&
 		    chk_addr_ret != RTN_LOCAL &&
 		    chk_addr_ret != RTN_MULTICAST &&
-		    chk_addr_ret != RTN_BROADCAST)
+		    chk_addr_ret != RTN_BROADCAST) {
+			err = -EADDRNOTAVAIL;
 			goto out;
+		}
 	} else {
 		if (addr_type != IPV6_ADDR_ANY) {
 			struct net_device *dev = NULL;

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-08-27 20:12 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-08-27 15:16 regression: Apparently missing err assignment in ipv6 bind Maciej Żenczykowski
2009-08-27 20:12 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox