From: Lou Berger Date: Tue, 12 Jan 2016 18:41:51 +0000 (-0500) Subject: bgpd: add nexthop length to AF macro X-Git-Tag: frr-2.0-rc1~691 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=95b9c671be55f45a2bae5d2ab1bb651cec7f023d;p=matthieu%2Ffrr.git bgpd: add nexthop length to AF macro Signed-off-by: Lou Berger Signed-off-by: David Lamparter (cherry picked from commit 3e841d3b49bdb475ce793eee5d82e5137dff57d3) --- diff --git a/bgpd/bgp_nexthop.h b/bgpd/bgp_nexthop.h index ff18e7dc43..a2d5ffdcc7 100644 --- a/bgpd/bgp_nexthop.h +++ b/bgpd/bgp_nexthop.h @@ -25,6 +25,15 @@ Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA #include "queue.h" #include "prefix.h" +#define NEXTHOP_FAMILY(nexthop_len) ( \ + ((nexthop_len) == 4 || \ + (nexthop_len) == 12 ? AF_INET : \ + ((nexthop_len) == 16 || \ + (nexthop_len) == 24 || \ + (nexthop_len) == 48 ? AF_INET6 : \ + AF_UNSPEC)) \ +) + /* BGP nexthop cache value structure. */ struct bgp_nexthop_cache {