]> git.puffer.fish Git - matthieu/frr.git/commitdiff
nhrpd: Set correct MTU in NHRP extensions
authorAmol Lad <amol.lad@4rf.com>
Wed, 24 Feb 2021 09:36:00 +0000 (15:06 +0530)
committerReuben Dowle <reuben.dowle@4rf.com>
Thu, 18 Mar 2021 03:35:41 +0000 (16:35 +1300)
Signed-off-by: Reuben Dowle <reuben.dowle@4rf.com>
nhrpd/nhrp_nhs.c
nhrpd/nhrp_packet.c
nhrpd/nhrp_peer.c
nhrpd/nhrp_shortcut.c

index ccf374e56319ad865d8c1cf115e695c742f13fd5..eaa9826b846cb18c744b702f255cd2538ff49765 100644 (file)
@@ -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);
index a983aa71bca91997184b3fe268e0768fee8b8868..fd77533c8957309e4a72d54755457e451d0fffc9 100644 (file)
@@ -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:
index dca81c9b2cc64475e3a138244e9b156e64b8b949..ac64b791ff097fdb9648c7199de48eebda0eb3ba 100644 (file)
@@ -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;
index b12e45eaf0942ee630b23a1ffbd1a89fdd472106..32a7ccbc906afede98d958f6369349987172e19d 100644 (file)
@@ -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);
        }