From 6407da5a2484df72169e31339a53b2b3ef62f35f Mon Sep 17 00:00:00 2001 From: vivek Date: Sat, 11 Jun 2016 11:36:42 -0700 Subject: 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 Updates: 945c8fe, 8ecd326, bb86c60, 93b73df, f4c8985 --- bgpd/bgp_updgrp_packet.c | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) (limited to 'bgpd/bgp_updgrp_packet.c') 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; -- cgit v1.2.3