]> git.puffer.fish Git - mirror/frr.git/commitdiff
nhrpd: Use MTU received in registration in nhs cache
authorGaurav Goyal <gaurav.goyal@4rf.com>
Thu, 19 Nov 2020 21:31:01 +0000 (10:31 +1300)
committerReuben Dowle <reuben.dowle@4rf.com>
Wed, 16 Dec 2020 21:17:13 +0000 (10:17 +1300)
Signed-off-by: Reuben Dowle <reuben.dowle@4rf.com>
nhrpd/nhrp_nhs.c

index 3b604593c8c38601bda47eb17c641b6fff3017ad..286b0f9820b8bb7faea6ba53bff1590a8c896c8c 100755 (executable)
@@ -35,6 +35,7 @@ static void nhrp_reg_reply(struct nhrp_reqid *reqid, void *arg)
        union sockunion cie_nbma, cie_proto, *proto;
        char buf[64];
        int ok = 0, holdtime;
+       unsigned short mtu = 0;
 
        nhrp_reqid_free(&nhrp_packet_reqid, &r->reqid);
 
@@ -57,6 +58,8 @@ static void nhrp_reg_reply(struct nhrp_reqid *reqid, void *arg)
                      || (cie->code == NHRP_CODE_ADMINISTRATIVELY_PROHIBITED
                          && nhs->hub)))
                        ok = 0;
+               mtu = ntohs(cie->mtu);
+               debugf(NHRP_DEBUG_COMMON, "NHS: CIE MTU: %d", mtu);
        }
 
        if (!ok)
@@ -96,7 +99,7 @@ static void nhrp_reg_reply(struct nhrp_reqid *reqid, void *arg)
        c = nhrp_cache_get(ifp, &p->dst_proto, 1);
        if (c)
                nhrp_cache_update_binding(c, NHRP_CACHE_NHS, holdtime,
-                                         nhrp_peer_ref(r->peer), 0, NULL);
+                                         nhrp_peer_ref(r->peer), mtu, NULL);
 }
 
 static int nhrp_reg_timeout(struct thread *t)