diff options
author | vivek <vivek@cumulusnetworks.com> | 2016-06-11 20:36:42 +0200 |
---|---|---|
committer | vivek <vivek@cumulusnetworks.com> | 2016-06-11 20:36:42 +0200 |
commit | 6407da5a2484df72169e31339a53b2b3ef62f35f (patch) | |
tree | b86f8fe6545aea24bbf5848345e132d4e1f40aa1 /bgpd/bgp_updgrp_packet.c | |
parent | redhat: Cleanup some unneeded parameters (diff) | |
download | frr-6407da5a2484df72169e31339a53b2b3ef62f35f.tar.xz frr-6407da5a2484df72169e31339a53b2b3ef62f35f.zip |
bgpd: Fixes and updates for VPNv6
VPNv6 changes picked from upstream needed fixes and updates due to some
fundamental changes implemented by Cumulus (BGP update-groups, RFC 5549
and nexthop setting etc.) which aren't present upstream.
Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
Updates: 945c8fe, 8ecd326, bb86c60, 93b73df, f4c8985
Diffstat (limited to 'bgpd/bgp_updgrp_packet.c')
-rw-r--r-- | bgpd/bgp_updgrp_packet.c | 21 |
1 files changed, 7 insertions, 14 deletions
diff --git a/bgpd/bgp_updgrp_packet.c b/bgpd/bgp_updgrp_packet.c index 63f88e932..3cb3ddcde 100644 --- a/bgpd/bgp_updgrp_packet.c +++ b/bgpd/bgp_updgrp_packet.c @@ -676,18 +676,10 @@ subgroup_update_packet (struct update_subgroup *subgrp) /* If packet is empty, set attribute. */ if (stream_empty (s)) { - struct prefix_rd *prd = NULL; - u_char *tag = NULL; struct peer *from = NULL; - if (rn->prn) - prd = (struct prefix_rd *) &rn->prn->p; if (binfo) - { - from = binfo->peer; - if (binfo->extra) - tag = binfo->extra->tag; - } + from = binfo->peer; /* 1: Write the BGP message header - 16 bytes marker, 2 bytes length, * one byte message type. @@ -710,12 +702,13 @@ subgroup_update_packet (struct update_subgroup *subgrp) /* 5: Encode all the attributes, except MP_REACH_NLRI attr. */ total_attr_len = bgp_packet_attribute (NULL, peer, s, adv->baa->attr, &vecarr, - &rn->p, afi, safi, - from, prd, tag, 0, 0); + NULL, afi, safi, + from, NULL, NULL, 0, 0); space_remaining = STREAM_CONCAT_REMAIN (s, snlri, STREAM_SIZE(s)) - BGP_MAX_PACKET_SIZE_OVERFLOW; - space_needed = BGP_NLRI_LENGTH + PSIZE (rn->p.prefixlen); + space_needed = BGP_NLRI_LENGTH + + bgp_packet_mpattr_prefix_size (afi, safi, &rn->p); /* If the attributes alone do not leave any room for NLRI then * return */ @@ -879,8 +872,8 @@ subgroup_withdraw_packet (struct update_subgroup *subgrp) space_remaining = STREAM_REMAIN (s) - BGP_MAX_PACKET_SIZE_OVERFLOW; - space_needed = (BGP_NLRI_LENGTH + BGP_TOTAL_ATTR_LEN + - PSIZE (rn->p.prefixlen)); + space_needed = BGP_NLRI_LENGTH + BGP_TOTAL_ATTR_LEN + + bgp_packet_mpattr_prefix_size (afi, safi, &rn->p); if (space_remaining < space_needed) break; |