Skip to contentSkip to conversation

IN_BADCLASS: fix macro to actually work

PATCH Applied Greg Kroah-Hartman 2 participants 2 messages Jan 10, 2019 – Jan 16, 2019

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 IN_BADCLASS: fix macro to actually work

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.

Fixes 65cab850f0ee ("net: Allow class-e address assignment via ifconfig ioctl")
Cc Dave Taht <[email protected]>
---
 include/uapi/linux/in.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/uapi/linux/in.h +1 -1
index f6052e70bf40..a55cb8b10165 100644
@@ -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)
Signature · 1 line
2.20.1
maintainer Applied
#1 lore raw

From: Greg Kroah-Hartman <[email protected]>
Date: Thu, 10 Jan 2019 21:24:13 +0100

Quoted 5 lines

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.

Quoted 7 lines

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.

Fixes 65cab850f0ee ("net: Allow class-e address assignment via ifconfig ioctl")
Cc Dave Taht <[email protected]>

Applied.