From 1b817c78e6991e006c9c9d44cf678c1e57b9f6fa Mon Sep 17 00:00:00 2001 From: mitesh Date: Mon, 5 Feb 2018 13:24:57 -0800 Subject: [PATCH] bgpd: use BGP_LABEL_BYTES instead of a mogic number '3' While processing the type-2 evpn route nlri, increment the pointer by BGP_LABEL_BYTES instead of '3' Signed-off-by: Mitesh Kanjariya --- bgpd/bgp_evpn.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bgpd/bgp_evpn.c b/bgpd/bgp_evpn.c index 3ef563c37c..7724a0eec8 100644 --- a/bgpd/bgp_evpn.c +++ b/bgpd/bgp_evpn.c @@ -2874,7 +2874,7 @@ static int process_type2_route(struct peer *peer, afi_t afi, safi_t safi, num_labels++; memset(label, 0, sizeof(label)); memcpy(&label[0], pfx, BGP_LABEL_BYTES); - pfx += 3; + pfx += BGP_LABEL_BYTES; psize -= (33 + ipaddr_len); /* Do we have a second VNI? */ if (psize) { @@ -2882,7 +2882,7 @@ static int process_type2_route(struct peer *peer, afi_t afi, safi_t safi, memcpy(&label[1], pfx, BGP_LABEL_BYTES); /* * If in future, we are required to access additional fields, - * we MUST increment pfx by 3 in before reading the next field + * we MUST increment pfx by BGP_LABEL_BYTES in before reading the next field */ } @@ -3042,7 +3042,7 @@ static int process_type5_route(struct peer *peer, afi_t afi, safi_t safi, /* * If in future, we are required to access additional fields, - * we MUST increment pfx by 3 in before reading the next field + * we MUST increment pfx by BGP_LABEL_BYTES in before reading the next field */ /* Process the route. */ -- 2.39.5