From fa144b5ae9888b5fd604a8ff0e562703a0225d5d Mon Sep 17 00:00:00 2001 From: Antonio Cardace Date: Tue, 24 Dec 2019 15:17:16 +0100 Subject: [PATCH] platform/linux: add support for /31 prefixes on IPv4 point-to-point links Previously NetworkManager would wrongly add a broadcast address for the network prefix that would collide with the IP address of the host on the other end of the point-to-point link thus exhausting the IP address space of the /31 network and preventing communication between the two nodes. Configuring a /31 address before this commit: IP addr -> 10.0.0.0/31, broadcast addr -> 10.0.0.1 If 10.0.0.1 is configured as a broadcast address the communication with host 10.0.0.1 will not be able to take place. Configuring a /31 address after this commit: IP addr -> 10.0.0.0/31, no broadcast address Thus 10.0.0.0/31 and 10.0.0.1/31 are able to correctly communicate. See RFC-3021. https://tools.ietf.org/html/rfc3021 https://gitlab.freedesktop.org/NetworkManager/NetworkManager/issues/295 https://bugzilla.redhat.com/show_bug.cgi?id=1764986 --- src/platform/nm-linux-platform.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/platform/nm-linux-platform.c b/src/platform/nm-linux-platform.c index 4f8c900491..f7a4504100 100644 --- a/src/platform/nm-linux-platform.c +++ b/src/platform/nm-linux-platform.c @@ -3937,6 +3937,7 @@ _nl_msg_new_address (int nlmsg_type, if ( family == AF_INET && nlmsg_type != RTM_DELADDR + && plen < 31 /* RFC 3021 */ && address && *((in_addr_t *) address) != 0) { in_addr_t broadcast;