diff options
| author | Denis Ovsienko <infrastation@yandex.ru> | 2011-12-17 19:39:30 +0400 | 
|---|---|---|
| committer | Denis Ovsienko <infrastation@yandex.ru> | 2012-01-02 17:27:34 +0400 | 
| commit | 45b341f72df6d7dd89133dfd21f43cf1cca74ce5 (patch) | |
| tree | 246e9cc5029eab48ad46d51359017fe22fe6e819 /bgpd/bgp_route.c | |
| parent | b31d8fc3016615571f79161b8405aa4033cdfb8d (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/bgp_route.c')
| -rw-r--r-- | bgpd/bgp_route.c | 8 | 
1 files changed, 4 insertions, 4 deletions
| diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c index 98e49bcd..189929a0 100644 --- a/bgpd/bgp_route.c +++ b/bgpd/bgp_route.c @@ -1815,9 +1815,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); @@ -2071,11 +2071,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; | 
