Roel Kluin | 7 Oct 2009 12:59
Picon
Gravatar

[PATCH] x25: bit and/or confusion in x25_ioctl()?

Looking at commit ebc3f64b864f it appears that this was intended
and not the original, equivalent to `if (facilities.reverse & ~0x81)'.

In x25_parse_facilities() that patch changed how facilities->reverse
was set. No other bits were set than 0x80 and/or 0x01.

Signed-off-by: Roel Kluin <roel.kluin <at> gmail.com>
---
This is correct isn't it?

diff --git a/net/x25/af_x25.c b/net/x25/af_x25.c
index 7fa9c7a..ca4dc28 100644
--- a/net/x25/af_x25.c
+++ b/net/x25/af_x25.c
 <at>  <at>  -1363,7 +1363,7  <at>  <at>  static int x25_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
 			    facilities.throughput > 0xDD)
 				break;
 			if (facilities.reverse &&
-				(facilities.reverse | 0x81)!= 0x81)
+				(facilities.reverse & 0x81) != 0x81)
 				break;
 			x25->facilities = facilities;
 			rc = 0;
--
To unsubscribe from this list: send the line "unsubscribe linux-x25" in
the body of a message to majordomo <at> vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

David Miller | 13 Oct 2009 12:47
Favicon

Re: [PATCH] x25: bit and/or confusion in x25_ioctl()?

From: Roel Kluin <roel.kluin <at> gmail.com>
Date: Wed, 07 Oct 2009 12:59:42 +0200

> Looking at commit ebc3f64b864f it appears that this was intended
> and not the original, equivalent to `if (facilities.reverse & ~0x81)'.
> 
> In x25_parse_facilities() that patch changed how facilities->reverse
> was set. No other bits were set than 0x80 and/or 0x01.
> 
> Signed-off-by: Roel Kluin <roel.kluin <at> gmail.com>

Looks good to me, applied to net-next-2.6
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo <at> vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Gmane