From 6b11bd8d3f6f713c939a873c7c17213c1e7889e1 Mon Sep 17 00:00:00 2001 From: mitesh Date: Wed, 24 Jan 2018 14:03:05 -0800 Subject: [PATCH] bgpd: fix SA issues Signed-off-by: Mitesh KAnjariya --- bgpd/bgp_evpn.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/bgpd/bgp_evpn.c b/bgpd/bgp_evpn.c index 8ad8dc8ee2..3ef563c37c 100644 --- a/bgpd/bgp_evpn.c +++ b/bgpd/bgp_evpn.c @@ -2880,7 +2880,10 @@ static int process_type2_route(struct peer *peer, afi_t afi, safi_t safi, if (psize) { num_labels++; memcpy(&label[1], pfx, BGP_LABEL_BYTES); - pfx += 3; + /* + * If in future, we are required to access additional fields, + * we MUST increment pfx by 3 in before reading the next field + */ } /* Process the route. */ @@ -3036,7 +3039,11 @@ static int process_type5_route(struct peer *peer, afi_t afi, safi_t safi, /* Get the VNI (in MPLS label field). Stored as bytes here. */ memset(&label, 0, sizeof(label)); memcpy(&label, pfx, BGP_LABEL_BYTES); - pfx += 3; + + /* + * If in future, we are required to access additional fields, + * we MUST increment pfx by 3 in before reading the next field + */ /* Process the route. */ if (!withdraw) -- 2.39.5