From: Amol Lad Date: Wed, 24 Feb 2021 09:36:00 +0000 (+0530) Subject: nhrpd: Set correct MTU in NHRP extensions X-Git-Tag: base_8.0~183^2~16 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=1e52c95464172df774bf75dbcd3d7f1d8b6e09cb;p=matthieu%2Ffrr.git nhrpd: Set correct MTU in NHRP extensions Signed-off-by: Reuben Dowle --- diff --git a/nhrpd/nhrp_nhs.c b/nhrpd/nhrp_nhs.c index ccf374e563..eaa9826b84 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 a983aa71bc..fd77533c89 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 dca81c9b2c..ac64b791ff 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 b12e45eaf0..32a7ccbc90 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); }