diff options
author | Donatas Abraitis <donatas.abraitis@gmail.com> | 2019-09-13 10:43:44 +0200 |
---|---|---|
committer | Donatas Abraitis <donatas.abraitis@gmail.com> | 2019-09-13 10:43:44 +0200 |
commit | 0606039c19ce31ea535d19d7a1259ad9b1ce95ad (patch) | |
tree | 2ac715ffaca7c5938b4040eac1dddbb290da76bb /bgpd/rfapi/vnc_export_bgp.c | |
parent | Merge pull request #4968 from rubenk/fix-surname (diff) | |
download | frr-0606039c19ce31ea535d19d7a1259ad9b1ce95ad.tar.xz frr-0606039c19ce31ea535d19d7a1259ad9b1ce95ad.zip |
bgpd: Use defined constants for NHLEN instead of numeric values
This is better in cases when you need to find specific pattern and/or
replacing.
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
Diffstat (limited to '')
-rw-r--r-- | bgpd/rfapi/vnc_export_bgp.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/bgpd/rfapi/vnc_export_bgp.c b/bgpd/rfapi/vnc_export_bgp.c index 3d8d5bccb..b97c8c303 100644 --- a/bgpd/rfapi/vnc_export_bgp.c +++ b/bgpd/rfapi/vnc_export_bgp.c @@ -86,13 +86,13 @@ static void encap_attr_export_ce(struct attr *new, struct attr *orig, switch (use_nexthop->family) { case AF_INET: new->nexthop = use_nexthop->u.prefix4; - new->mp_nexthop_len = 4; /* bytes */ + new->mp_nexthop_len = BGP_ATTR_NHLEN_IPV4; /* bytes */ new->flag |= ATTR_FLAG_BIT(BGP_ATTR_NEXT_HOP); break; case AF_INET6: new->mp_nexthop_global = use_nexthop->u.prefix6; - new->mp_nexthop_len = 16; /* bytes */ + new->mp_nexthop_len = BGP_ATTR_NHLEN_IPV6_GLOBAL; /* bytes */ break; default: @@ -624,13 +624,13 @@ encap_attr_export(struct attr *new, struct attr *orig, switch (use_nexthop->family) { case AF_INET: new->nexthop = use_nexthop->u.prefix4; - new->mp_nexthop_len = 4; /* bytes */ + new->mp_nexthop_len = BGP_ATTR_NHLEN_IPV4; /* bytes */ new->flag |= ATTR_FLAG_BIT(BGP_ATTR_NEXT_HOP); break; case AF_INET6: new->mp_nexthop_global = use_nexthop->u.prefix6; - new->mp_nexthop_len = 16; /* bytes */ + new->mp_nexthop_len = BGP_ATTR_NHLEN_IPV6_GLOBAL; /* bytes */ break; default: |