All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] IN_BADCLASS: fix macro to actually work
@ 2019-01-10 20:24 Greg Kroah-Hartman
  2019-01-16  5:45 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Greg Kroah-Hartman @ 2019-01-10 20:24 UTC (permalink / raw)
  To: netdev, Dave Taht; +Cc: Christopher Ferris

Commit 65cab850f0ee ("net: Allow class-e address assignment via ifconfig
ioctl") modified the IN_BADCLASS macro a bit, but unfortunatly one too
many '(' characters were added to the line, making any code that used
it, not build properly.

Also, the macro now compares an unsigned with a signed value, which
isn't ok, so fix that up by making both types match properly.

Reported-by: Christopher Ferris <cferris@google.com>
Fixes: 65cab850f0ee ("net: Allow class-e address assignment via ifconfig ioctl")
Cc: Dave Taht <dave.taht@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 include/uapi/linux/in.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/uapi/linux/in.h b/include/uapi/linux/in.h
index f6052e70bf40..a55cb8b10165 100644
--- a/include/uapi/linux/in.h
+++ b/include/uapi/linux/in.h
@@ -268,7 +268,7 @@ struct sockaddr_in {
 #define	IN_MULTICAST(a)		IN_CLASSD(a)
 #define	IN_MULTICAST_NET	0xe0000000
 
-#define	IN_BADCLASS(a)		((((long int) (a) ) == 0xffffffff)
+#define	IN_BADCLASS(a)		(((long int) (a) ) == (long int)0xffffffff)
 #define	IN_EXPERIMENTAL(a)	IN_BADCLASS((a))
 
 #define	IN_CLASSE(a)		((((long int) (a)) & 0xf0000000) == 0xf0000000)
-- 
2.20.1

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

* Re: [PATCH] IN_BADCLASS: fix macro to actually work
  2019-01-10 20:24 [PATCH] IN_BADCLASS: fix macro to actually work Greg Kroah-Hartman
@ 2019-01-16  5:45 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2019-01-16  5:45 UTC (permalink / raw)
  To: gregkh; +Cc: netdev, dave.taht, cferris

From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Date: Thu, 10 Jan 2019 21:24:13 +0100

> Commit 65cab850f0ee ("net: Allow class-e address assignment via ifconfig
> ioctl") modified the IN_BADCLASS macro a bit, but unfortunatly one too
> many '(' characters were added to the line, making any code that used
> it, not build properly.
> 
> Also, the macro now compares an unsigned with a signed value, which
> isn't ok, so fix that up by making both types match properly.
> 
> Reported-by: Christopher Ferris <cferris@google.com>
> Fixes: 65cab850f0ee ("net: Allow class-e address assignment via ifconfig ioctl")
> Cc: Dave Taht <dave.taht@gmail.com>
> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Applied.

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

end of thread, other threads:[~2019-01-16  5:45 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-10 20:24 [PATCH] IN_BADCLASS: fix macro to actually work Greg Kroah-Hartman
2019-01-16  5:45 ` David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.