The variable 'err' is set in rawv6_bind() before the address check fails instead of after, moved inside if() statement.

Signed-off-by: Brian Haley <[EMAIL PROTECTED]>
diff --git a/net/ipv6/raw.c b/net/ipv6/raw.c
index 8a30cd8..072b28b 100644
--- a/net/ipv6/raw.c
+++ b/net/ipv6/raw.c
@@ -240,10 +240,10 @@ static int rawv6_bind(struct sock *sk, s
 		 */
 		v4addr = LOOPBACK4_IPV6;
 		if (!(addr_type & IPV6_ADDR_MULTICAST))	{
-			err = -EADDRNOTAVAIL;
 			if (!ipv6_chk_addr(&addr->sin6_addr, dev, 0)) {
 				if (dev)
 					dev_put(dev);
+				err = -EADDRNOTAVAIL;
 				goto out;
 			}
 		}

Reply via email to