lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Fri, 03 Feb 2012 11:01:18 +0100
From:	Eric Dumazet <eric.dumazet@...il.com>
To:	"Erich E. Hoover" <ehoover@...es.edu>
Cc:	Linux Netdev <netdev@...r.kernel.org>
Subject: Re: [PATCH v2] Implement IP_UNICAST_IF socket option.

Le jeudi 02 février 2012 à 18:22 -0700, Erich E. Hoover a écrit :

> I though I should double check this, and apparently I missed that
> there's an equivalent IPV6_UNICAST_IF on "other OS".  Should that be a
> patch 2 or should it be included in this one?

Do as you prefer.

BTW, do we really want the htonl() thing, and force device indexes in
2^24 range ? This seems odd anyway.

If yes, following patch is needed :

diff --git a/net/core/dev.c b/net/core/dev.c
index f124947..ce7ebde 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -5193,7 +5193,10 @@ static int dev_new_index(struct net *net)
 {
 	static int ifindex;
 	for (;;) {
-		if (++ifindex <= 0)
+		/* Because of IP_UNICAST_IF support, we must limit indexes
+		 * to 24 bits. Zero value is also reserved.
+		 */
+		if (++ifindex >= (1<<24))
 			ifindex = 1;
 		if (!__dev_get_by_index(net, ifindex))
 			return ifindex;


--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ