summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDonald Sharp <donaldsharp72@gmail.com>2023-08-24 10:55:51 -0400
committerGitHub <noreply@github.com>2023-08-24 10:55:51 -0400
commit42016422ce39bb1dd154531ee39f8b14ffed8fe7 (patch)
tree8d41ae53991a10858c0393859589fa58498c0bb1
parent673a11a54fc6948641fe56e41720d0f900c9353c (diff)
parent28ccc24d38df1d51ed8a563507e5d6f6171fdd38 (diff)
Merge pull request #14260 from opensourcerouting/fix/do_not_process_nlri_if_attribute_len_is_0
bgpd: Do not process NLRIs if the attribute length is zero
-rw-r--r--bgpd/bgp_packet.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/bgpd/bgp_packet.c b/bgpd/bgp_packet.c
index bf7f215905..a9e772e243 100644
--- a/bgpd/bgp_packet.c
+++ b/bgpd/bgp_packet.c
@@ -2049,7 +2049,7 @@ static int bgp_update_receive(struct peer *peer, bgp_size_t size)
/* Network Layer Reachability Information. */
update_len = end - stream_pnt(s);
- if (update_len) {
+ if (update_len && attribute_len) {
/* Set NLRI portion to structure. */
nlris[NLRI_UPDATE].afi = AFI_IP;
nlris[NLRI_UPDATE].safi = SAFI_UNICAST;