kernel: N_BADCLASS: fix macro to actually work - class e support
authorKevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
Sat, 19 Jan 2019 19:42:21 +0000 (19:42 +0000)
committerKevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
Sat, 19 Jan 2019 20:45:49 +0000 (20:45 +0000)
Backport upstream patch:

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>
Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
target/linux/generic/backport-4.14/095-Allow-class-e-address-assignment-via-ifconfig-ioctl.patch
target/linux/generic/backport-4.19/095-Allow-class-e-address-assignment-via-ifconfig-ioctl.patch
target/linux/generic/backport-4.9/095-Allow-class-e-address-assignment-via-ifconfig-ioctl.patch

index fec083dadb651c89992bf5857828249a9a952a4e..ade5c6cc23985a29cb793fc911d7fe546a4c4ed2 100644 (file)
@@ -37,7 +37,7 @@ Reviewed-by: John Gilmore <gnu@toad.com>
  
 -#define       IN_EXPERIMENTAL(a)      ((((long int) (a)) & 0xf0000000) == 0xf0000000)
 -#define       IN_BADCLASS(a)          IN_EXPERIMENTAL((a))
-+#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)
index 861e1061e05d9de6ab9d5876f3caf7ce7f21e62a..5d49a406c45200f4bb5050a6dafcb12e7d328f24 100644 (file)
@@ -37,7 +37,7 @@ Reviewed-by: John Gilmore <gnu@toad.com>
  
 -#define       IN_EXPERIMENTAL(a)      ((((long int) (a)) & 0xf0000000) == 0xf0000000)
 -#define       IN_BADCLASS(a)          IN_EXPERIMENTAL((a))
-+#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)
index fd804888ff6f513b013cf7e7d3c3e467c470d835..38ae0766785bc26bf524d697f4e97d8b46715e19 100644 (file)
@@ -37,7 +37,7 @@ Reviewed-by: John Gilmore <gnu@toad.com>
  
 -#define       IN_EXPERIMENTAL(a)      ((((long int) (a)) & 0xf0000000) == 0xf0000000)
 -#define       IN_BADCLASS(a)          IN_EXPERIMENTAL((a))
-+#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)