diff options
author | Gaurav Goyal <gaurav.goyal@4rf.com> | 2021-03-11 03:59:41 +0100 |
---|---|---|
committer | Reuben Dowle <reuben.dowle@4rf.com> | 2021-03-18 04:35:41 +0100 |
commit | bb58f4425920cec76196e467403bb084e3a14e76 (patch) | |
tree | 5bc1bb4888a8960017a489015d6eb3049bc73503 /nhrpd/nhrp_nhs.c | |
parent | nhrpd: Add zbuf routine to peek at contents (diff) | |
download | frr-bb58f4425920cec76196e467403bb084e3a14e76.tar.xz frr-bb58f4425920cec76196e467403bb084e3a14e76.zip |
nhrpd: Process NAT extension properly, and also fallback to IPSec NAT info
Signed-off-by: Reuben Dowle <reuben.dowle@4rf.com>
Diffstat (limited to 'nhrpd/nhrp_nhs.c')
-rw-r--r-- | nhrpd/nhrp_nhs.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/nhrpd/nhrp_nhs.c b/nhrpd/nhrp_nhs.c index de1bdbd16..ccf374e56 100644 --- a/nhrpd/nhrp_nhs.c +++ b/nhrpd/nhrp_nhs.c @@ -442,3 +442,24 @@ void nhrp_nhs_foreach(struct interface *ifp, afi_t afi, cb(nhs, 0, ctx); } } + +int nhrp_nhs_match_ip(union sockunion *in_ip, struct nhrp_interface *nifp) { + int i; + struct nhrp_nhs *nhs; + struct nhrp_registration *reg; + for (i=0; i < AFI_MAX; i++) + { + list_for_each_entry(nhs, &nifp->afi[i].nhslist_head, nhslist_entry) + { + if (!list_empty(&nhs->reglist_head)) { + list_for_each_entry(reg, &nhs->reglist_head, + reglist_entry) + { + if (!sockunion_cmp(in_ip, ®->peer->vc->remote.nbma)) + return 1; + } + } + } + } + return 0; +} |