diff options
| author | Ghasem Naddaf <ghasem.naddaf@gmail.com> | 2020-02-27 10:55:47 -0800 | 
|---|---|---|
| committer | Ghasem Naddaf <ghasem.naddaf@gmail.com> | 2020-02-27 10:55:47 -0800 | 
| commit | 47d4075766baa2020fc8de913a1a74e7dc430c22 (patch) | |
| tree | ad4e21c5b5834ce88558a3c475c592eaf5644984 /nhrpd/nhrp_shortcut.c | |
| parent | e9178b8ba3b93bf3ea57f3f84bb5025c69decbe2 (diff) | |
nhrpd: add holdtime and MTU to CIE
nhrp_shortcut_send_resolution_req: Add Holding time and MTU to the resolution request CIE according to RFC2332 Sec. 5.2.1.
nhrp_handle_resolution_req: Parse Holding time and MTU from CIE and update the requestor's binding. Also, when preparing the resolution reply, copy the Holding time and MTU to the CIE according to RFC2332 Sec. 5.2.2.
Signed-off-by: Ghasem Naddaf <gshirazi@infoblox.com>
Diffstat (limited to 'nhrpd/nhrp_shortcut.c')
| -rw-r--r-- | nhrpd/nhrp_shortcut.c | 13 | 
1 files changed, 12 insertions, 1 deletions
diff --git a/nhrpd/nhrp_shortcut.c b/nhrpd/nhrp_shortcut.c index b3fdecf0ec..1f83b793af 100644 --- a/nhrpd/nhrp_shortcut.c +++ b/nhrpd/nhrp_shortcut.c @@ -306,7 +306,9 @@ static void nhrp_shortcut_send_resolution_req(struct nhrp_shortcut *s)  	struct nhrp_packet_header *hdr;  	struct interface *ifp;  	struct nhrp_interface *nifp; +	struct nhrp_afi_data *if_ad;  	struct nhrp_peer *peer; +	struct nhrp_cie_header *cie;  	if (nhrp_route_address(NULL, &s->addr, NULL, &peer)  	    != NHRP_ROUTE_NBMA_NEXTHOP) @@ -336,7 +338,16 @@ static void nhrp_shortcut_send_resolution_req(struct nhrp_shortcut *s)  	 *  - MTU: MTU of the source station  	 *  - Holding Time: Max time to cache the source information  	 * */ -	/* FIXME: Send holding time, and MTU */ +	/* FIXME: push CIE for each local protocol address */ +	cie = nhrp_cie_push(zb, NHRP_CODE_SUCCESS, NULL, NULL); +	cie->prefix_length = 0xff; +	if_ad = &nifp->afi[family2afi(sockunion_family(&s->addr))]; +	cie->holding_time = htons(if_ad->holdtime); +	cie->mtu = htons(if_ad->mtu); +	debugf(NHRP_DEBUG_COMMON, +	       "Shortcut res_req: set cie holdtime to %u " +	       "and mtu to %u. shortcut's holdtime is %u.", +	       ntohs(cie->holding_time), ntohs(cie->mtu), s->holding_time);  	nhrp_ext_request(zb, hdr, ifp);  | 
