summaryrefslogtreecommitdiff
path: root/lib/prefix.h
diff options
context:
space:
mode:
authorTomas Hozza <thozza@redhat.com>2019-08-01 12:19:34 +0200
committerTomas Hozza <thozza@redhat.com>2019-08-05 09:24:29 +0200
commit2d48474e03798c6bf5281301fa818b94a0b5597d (patch)
treef76b7d0c4944dfca4ea60219075a2b7fcbbf5c52 /lib/prefix.h
parentec3b947f6edb3c77bf921419094370e71e1ad415 (diff)
lib/prefix.c: ipv4_broadcast_addr() didn't comply with RFC3021
The function ipv4_broadcast_addr() does not calculate correct broadcast addresses for point-to-point connections with prefix 31. RFC3021 section 3.3 [1] specifies: "The 255.255.255.255 IP broadcast address MUST be used for broadcast Address Mask Replies in point-to-point links with 31-bit subnet masks" The issue causes Zebra to print the following warning when IPv4 address with 31 prefix (e.g. 192.168.222.240/31) is configured on a network interface: ZEBRA: [EC 4043309141] warning: interface VNS broadcast addr 255.255.255.255/31 != calculated 192.168.222.241, routing protocols may malfunction The issue has been originally found in Quagga [2], but it is present also in FRR. [1] https://tools.ietf.org/html/rfc3021#section-3.3 [2] https://bugzilla.redhat.com/show_bug.cgi?id=1713449 Signed-off-by: Tomas Hozza <thozza@redhat.com>
Diffstat (limited to 'lib/prefix.h')
-rw-r--r--lib/prefix.h3
1 files changed, 1 insertions, 2 deletions
diff --git a/lib/prefix.h b/lib/prefix.h
index e338140f1a..7a7e13518a 100644
--- a/lib/prefix.h
+++ b/lib/prefix.h
@@ -451,8 +451,7 @@ extern void masklen2ip(const int, struct in_addr *);
extern in_addr_t ipv4_network_addr(in_addr_t hostaddr, int masklen);
/* given the address of a host on a network and the network mask length,
* calculate the broadcast address for that network;
- * special treatment for /31: returns the address of the other host
- * on the network by flipping the host bit */
+ * special treatment for /31 according to RFC3021 section 3.3 */
extern in_addr_t ipv4_broadcast_addr(in_addr_t hostaddr, int masklen);
extern int netmask_str2prefix_str(const char *, const char *, char *);