summaryrefslogtreecommitdiff
path: root/bgpd
diff options
context:
space:
mode:
authorDenis Ovsienko <infrastation@yandex.ru>2011-12-17 19:39:30 +0400
committerDenis Ovsienko <infrastation@yandex.ru>2012-01-02 18:37:42 +0400
commit733cd9e5792648de50da3c00805aacb51cb27048 (patch)
tree606ec20aa51f16b7a49fd9f5ede27893bee9ace9 /bgpd
parentde5ccb96023181765c9904ab40e645c397f536d6 (diff)
bgpd: justify checks for IPv4 class D/E
* lib/prefix.h * IPV4_CLASS_DE(): make consistent with counterpart macros * bgp_packet.c * bgp_open_receive(): test using macro instead of ">=" * bgp_route.c * bgp_update_rsclient(): idem * bgp_update_main(): idem
Diffstat (limited to 'bgpd')
-rw-r--r--bgpd/bgp_packet.c2
-rw-r--r--bgpd/bgp_route.c8
2 files changed, 5 insertions, 5 deletions
diff --git a/bgpd/bgp_packet.c b/bgpd/bgp_packet.c
index 2c0113da..f5a74d1b 100644
--- a/bgpd/bgp_packet.c
+++ b/bgpd/bgp_packet.c
@@ -1381,7 +1381,7 @@ bgp_open_receive (struct peer *peer, bgp_size_t size)
/* remote router-id check. */
if (remote_id.s_addr == 0
- || ntohl (remote_id.s_addr) >= 0xe0000000
+ || IPV4_CLASS_DE (ntohl (remote_id.s_addr))
|| ntohl (peer->local_id.s_addr) == ntohl (remote_id.s_addr))
{
if (BGP_DEBUG (normal, NORMAL))
diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c
index e325f66f..6477a7cc 100644
--- a/bgpd/bgp_route.c
+++ b/bgpd/bgp_route.c
@@ -1812,9 +1812,9 @@ bgp_update_rsclient (struct peer *rsclient, afi_t afi, safi_t safi,
/* IPv4 unicast next hop check. */
if (afi == AFI_IP && safi == SAFI_UNICAST)
{
- /* Next hop must not be 0.0.0.0 nor Class E address. */
+ /* Next hop must not be 0.0.0.0 nor Class D/E address. */
if (new_attr.nexthop.s_addr == 0
- || ntohl (new_attr.nexthop.s_addr) >= 0xe0000000)
+ || IPV4_CLASS_DE (ntohl (new_attr.nexthop.s_addr)))
{
bgp_attr_unintern (&attr_new);
@@ -2068,11 +2068,11 @@ bgp_update_main (struct peer *peer, struct prefix *p, struct attr *attr,
goto filtered;
}
- /* Next hop must not be 0.0.0.0 nor Class E address. Next hop
+ /* Next hop must not be 0.0.0.0 nor Class D/E address. Next hop
must not be my own address. */
if (bgp_nexthop_self (afi, &new_attr)
|| new_attr.nexthop.s_addr == 0
- || ntohl (new_attr.nexthop.s_addr) >= 0xe0000000)
+ || IPV4_CLASS_DE (ntohl (new_attr.nexthop.s_addr)))
{
reason = "martian next-hop;";
goto filtered;