diff options
author | Amol Lad <amol.lad@4rf.com> | 2021-02-24 10:36:00 +0100 |
---|---|---|
committer | Reuben Dowle <reuben.dowle@4rf.com> | 2021-03-18 04:35:41 +0100 |
commit | 1e52c95464172df774bf75dbcd3d7f1d8b6e09cb (patch) | |
tree | f99ed06de957a76ae41846f0f2c311347c3f6ad1 /nhrpd | |
parent | nhrpd: Send prefix length in NAT extension the same as is done by Cisco (diff) | |
download | frr-1e52c95464172df774bf75dbcd3d7f1d8b6e09cb.tar.xz frr-1e52c95464172df774bf75dbcd3d7f1d8b6e09cb.zip |
nhrpd: Set correct MTU in NHRP extensions
Signed-off-by: Reuben Dowle <reuben.dowle@4rf.com>
Diffstat (limited to 'nhrpd')
-rw-r--r-- | nhrpd/nhrp_nhs.c | 1 | ||||
-rw-r--r-- | nhrpd/nhrp_packet.c | 1 | ||||
-rw-r--r-- | nhrpd/nhrp_peer.c | 5 | ||||
-rw-r--r-- | nhrpd/nhrp_shortcut.c | 1 |
4 files changed, 7 insertions, 1 deletions
diff --git a/nhrpd/nhrp_nhs.c b/nhrpd/nhrp_nhs.c index ccf374e56..eaa9826b8 100644 --- a/nhrpd/nhrp_nhs.c +++ b/nhrpd/nhrp_nhs.c @@ -218,6 +218,7 @@ static int nhrp_reg_send_req(struct thread *t) ext = nhrp_ext_push(zb, hdr, NHRP_EXTENSION_NAT_ADDRESS); cie = nhrp_cie_push(zb, NHRP_CODE_SUCCESS, &nifp->nbma, &if_ad->addr); cie->prefix_length = 8 * sockunion_get_addrlen(&if_ad->addr); + cie->mtu = htons(if_ad->mtu); nhrp_ext_complete(zb, ext); nhrp_packet_complete(zb, hdr); diff --git a/nhrpd/nhrp_packet.c b/nhrpd/nhrp_packet.c index a983aa71b..fd77533c8 100644 --- a/nhrpd/nhrp_packet.c +++ b/nhrpd/nhrp_packet.c @@ -268,6 +268,7 @@ int nhrp_ext_reply(struct zbuf *zb, struct nhrp_packet_header *hdr, &ad->addr); if (!cie) goto err; + cie->mtu = htons(ad->mtu); cie->holding_time = htons(ad->holdtime); break; default: diff --git a/nhrpd/nhrp_peer.c b/nhrpd/nhrp_peer.c index dca81c9b2..ac64b791f 100644 --- a/nhrpd/nhrp_peer.c +++ b/nhrpd/nhrp_peer.c @@ -581,6 +581,7 @@ static void nhrp_handle_resolution_req(struct nhrp_packet_parser *pp) &nifp->nat_nbma, &pp->if_ad->addr); if (!cie) goto err; + cie->mtu = htons(pp->if_ad->mtu); nhrp_ext_complete(zb, ext); break; default: @@ -696,9 +697,10 @@ static void nhrp_handle_registration_request(struct nhrp_packet_parser *p) goto err; zbuf_copy(zb, &payload, zbuf_used(&payload)); if (natted) { - nhrp_cie_push(zb, NHRP_CODE_SUCCESS, + cie = nhrp_cie_push(zb, NHRP_CODE_SUCCESS, &p->peer->vc->remote.nbma, &p->src_proto); + cie->mtu = htons(p->if_ad->mtu); } nhrp_ext_complete(zb, ext); break; @@ -961,6 +963,7 @@ static void nhrp_peer_forward(struct nhrp_peer *p, &nifp->nbma, &if_ad->addr); if (!cie) goto err; + cie->mtu = htons(if_ad->mtu); cie->holding_time = htons(if_ad->holdtime); } break; diff --git a/nhrpd/nhrp_shortcut.c b/nhrpd/nhrp_shortcut.c index b12e45eaf..32a7ccbc9 100644 --- a/nhrpd/nhrp_shortcut.c +++ b/nhrpd/nhrp_shortcut.c @@ -427,6 +427,7 @@ static void nhrp_shortcut_send_resolution_req(struct nhrp_shortcut *s) cie = nhrp_cie_push(zb, NHRP_CODE_SUCCESS, &nifp->nat_nbma, &if_ad->addr); cie->prefix_length = 8 * sockunion_get_addrlen(&if_ad->addr); + cie->mtu = htons(if_ad->mtu); nhrp_ext_complete(zb, ext); } |