summaryrefslogtreecommitdiffstats
path: root/bgpd/bgp_attr.c
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2015-05-20 03:03:56 +0200
committerDonald Sharp <sharpd@cumulusnetworks.com>2015-05-20 03:03:56 +0200
commit58298ccd1a632212bae249c2b913e6addc2438bd (patch)
treea90e0c707938ab213c14ccad490149518cb0da8f /bgpd/bgp_attr.c
parentAlways add a keepalive to the OutQ when the KA timer expires (diff)
downloadfrr-58298ccd1a632212bae249c2b913e6addc2438bd.tar.xz
frr-58298ccd1a632212bae249c2b913e6addc2438bd.zip
Relax draft-ietf-idr-error-handling-13 valid IP check in favor of draft-ietf-idr-error-handling-14
Diffstat (limited to 'bgpd/bgp_attr.c')
-rw-r--r--bgpd/bgp_attr.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/bgpd/bgp_attr.c b/bgpd/bgp_attr.c
index 9ae46dbb3..72d130b44 100644
--- a/bgpd/bgp_attr.c
+++ b/bgpd/bgp_attr.c
@@ -1185,9 +1185,14 @@ bgp_attr_nexthop (struct bgp_attr_parser_args *args)
args->total);
}
+ /* According to section 6.3 of RFC4271, syntactically incorrect NEXT_HOP
+ attribute must result in a NOTIFICATION message (this is implemented below).
+ At the same time, semantically incorrect NEXT_HOP is more likely to be just
+ logged locally (this is implemented somewhere else). The UPDATE message
+ gets ignored in any of these cases. */
nexthop_n = stream_get_ipv4 (peer->ibuf);
nexthop_h = ntohl (nexthop_n);
- if (!bgp_valid_host_address(nexthop_h))
+ if (IPV4_NET0 (nexthop_h) || IPV4_NET127 (nexthop_h) || IPV4_CLASS_DE (nexthop_h))
{
char buf[INET_ADDRSTRLEN];
inet_ntop (AF_INET, &nexthop_n, buf, INET_ADDRSTRLEN);