35

Allow 0.0.0.0/8 as a valid address range

 4 years ago
source link: https://www.tuicool.com/articles/vEV3Qfy
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
author VvMBvyv.png!webjyYNfyF.png!web Dave Taht <[email protected]> 2019-06-22 10:07:34 -0700 committer 81279c43ce60f56aea992763d1ed612b?s=13&d=retro81279c43ce60f56aea992763d1ed612b?s=128&d=retro David S. Miller <[email protected]> 2019-06-26 13:19:46 -0700 commit 96125bf9985a75db00496dd2bc9249b777d2b19b ( patch ) tree d82dbc034874662d28e5b9b3eedc92c057f78cd4 parent c22a133a83ce64949dc35156eaefeda5a1e12bc3 ( diff ) download linux-96125bf9985a.tar.gz

Allow 0.0.0.0/8 as a valid address range

The longstanding prohibition against using 0.0.0.0/8 dates back to two issues with the early internet. There was an interoperability problem with BSD 4.2 in 1984, fixed in BSD 4.3 in 1986. BSD 4.2 has long since been retired. Secondly, addresses of the form 0.x.y.z were initially defined only as a source address in an ICMP datagram, indicating "node number x.y.z on this IPv4 network", by nodes that know their address on their local network, but do not yet know their network prefix, in RFC0792 (page 19). This usage of 0.x.y.z was later repealed in RFC1122 (section 3.2.2.7), because the original ICMP-based mechanism for learning the network prefix was unworkable on many networks such as Ethernet (which have longer addresses that would not fit into the 24 "node number" bits). Modern networks use reverse ARP (RFC0903) or BOOTP (RFC0951) or DHCP (RFC2131) to find their full 32-bit address and CIDR netmask (and other parameters such as default gateways). 0.x.y.z has had 16,777,215 addresses in 0.0.0.0/8 space left unused and reserved for future use, since 1989. This patch allows for these 16m new IPv4 addresses to appear within a box or on the wire. Layer 2 switches don't care. 0.0.0.0/32 is still prohibited, of course. Signed-off-by: Dave Taht <[email protected]> Signed-off-by: John Gilmore <[email protected]> Acked-by: Toke Høiland-Jørgensen <[email protected]> Signed-off-by: David S. Miller <[email protected]>

Diffstat

-rw-r--r-- include/linux/in.h 2

1 files changed, 1 insertions, 1 deletions

diff --git a/include/linux/in.h b/include/linux/in.h

index 4d2fedf..1873ef6 100644

--- a/include/linux/in.h

+++ b/include/linux/in.h

@@ -63,7 +63,7 @@ static inline bool ipv4_is_all_snoopers(__be32 addr)

static inline bool ipv4_is_zeronet(__be32 addr)

{

- return (addr & htonl(0xff000000)) == htonl(0x00000000);

+ return (addr == 0);

}

/* Special-Use IPv4 Addresses (RFC3330) */


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK