History

net: Allow class-e address assignment via ifconfig ioctl

While most distributions long ago switched to the iproute2 suite of utilities, which allow class-e (240.0.0.0/4) address assignment, distributions relying on busybox, toybox and other forms of ifconfig cannot assign class-e addresses without this kernel patch. While CIDR has been obsolete for 2 decades, and a survey of all the open source code in the world shows the IN_whatever macros are also obsolete... rather than obsolete CIDR from this ioctl entirely, this patch merely enables class-e assignment, sanely.

Dave Taht committed 7 years ago

Commit 65cab851 parent 69d2c863 files · +12 −5Browse files

Showing the changes to include/uapi/linux (1 of 3 files). Show all

Unified · Split

include/uapi/linux/in.h+7−3
@@ -266,10 +266,14 @@ struct sockaddr_in { · 265 unmodified lines
266266
267267 #define IN_CLASSD(a) ((((long int) (a)) & 0xf0000000) == 0xe0000000)
268268 #define IN_MULTICAST(a) IN_CLASSD(a)
269−#define IN_MULTICAST_NET 0xF0000000
269+#define IN_MULTICAST_NET 0xe0000000
270270
271−#define IN_EXPERIMENTAL(a) ((((long int) (a)) & 0xf0000000) == 0xf0000000)
272−#define IN_BADCLASS(a) IN_EXPERIMENTAL((a))
271+#define IN_BADCLASS(a) ((((long int) (a) ) == 0xffffffff)
272+#define IN_EXPERIMENTAL(a) IN_BADCLASS((a))
273+
274+#define IN_CLASSE(a) ((((long int) (a)) & 0xf0000000) == 0xf0000000)
275+#define IN_CLASSE_NET 0xffffffff
276+#define IN_CLASSE_NSHIFT 0
273277
274278 /* Address to accept any incoming messages. */
275279 #define INADDR_ANY ((unsigned long int) 0x00000000)