summaryrefslogtreecommitdiffstats
path: root/nhrpd/nhrp_peer.c
diff options
context:
space:
mode:
authorReuben Dowle <reuben.dowle@4rf.com>2021-03-15 04:25:25 +0100
committerReuben Dowle <reuben.dowle@4rf.com>2021-03-18 04:35:41 +0100
commit9025515c250eee5c2592ea0683f2c81994c2f8d1 (patch)
treecd4b88944f3d3f30bfd7f33d4a8de94bfe37fd46 /nhrpd/nhrp_peer.c
parentnhrpd: Use SU_ADDRSTRLEN where appropriate (diff)
downloadfrr-9025515c250eee5c2592ea0683f2c81994c2f8d1.tar.xz
frr-9025515c250eee5c2592ea0683f2c81994c2f8d1.zip
nhrpd: Ensure invalid NAT extension info cannot be used
Signed-off-by: Reuben Dowle <reuben.dowle@4rf.com>
Diffstat (limited to 'nhrpd/nhrp_peer.c')
-rw-r--r--nhrpd/nhrp_peer.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/nhrpd/nhrp_peer.c b/nhrpd/nhrp_peer.c
index fcada245e..74e502b21 100644
--- a/nhrpd/nhrp_peer.c
+++ b/nhrpd/nhrp_peer.c
@@ -393,12 +393,14 @@ static void nhrp_process_nat_extension(struct nhrp_packet_parser *pp,
struct nhrp_extension_header *ext;
struct zbuf *extensions;
-
- if (!proto || !cie_nbma || sockunion_family(proto) == AF_UNSPEC)
+ if (!cie_nbma)
return;
sockunion_family(cie_nbma) = AF_UNSPEC;
+ if (!proto || sockunion_family(proto) == AF_UNSPEC)
+ return;
+
/* Handle extensions */
extensions = zbuf_alloc(zbuf_used(&pp->extensions));
if (extensions) {