diff options
| author | Piotr Jurkiewicz <piotr.jerzy.jurkiewicz@gmail.com> | 2018-05-03 20:17:21 +0200 | 
|---|---|---|
| committer | Piotr Jurkiewicz <piotr.jerzy.jurkiewicz@gmail.com> | 2018-05-04 02:58:18 +0200 | 
| commit | ca83a1ab22840a552ca746a6f65a98acba2e5e71 (patch) | |
| tree | 841380cd0d81877840411acedc995c9eaa0f41a3 /eigrpd/eigrp_query.c | |
| parent | babf583e630d7ed7a7dd3920996e90f5728a6ead (diff) | |
eigrpd: Correctly calculate EIGRP packet MTU
Someone forgot that EIGRP packets are encapsulated in IP.
Signed-off-by: Piotr Jurkiewicz <piotr.jerzy.jurkiewicz@gmail.com>
Diffstat (limited to 'eigrpd/eigrp_query.c')
| -rw-r--r-- | eigrpd/eigrp_query.c | 5 | 
1 files changed, 3 insertions, 2 deletions
diff --git a/eigrpd/eigrp_query.c b/eigrpd/eigrp_query.c index 00234bb35c..8d13ef84d3 100644 --- a/eigrpd/eigrp_query.c +++ b/eigrpd/eigrp_query.c @@ -167,6 +167,7 @@ void eigrp_send_query(struct eigrp_interface *ei)  	struct eigrp_prefix_entry *pe;  	bool has_tlv = false;  	bool new_packet = true; +	uint16_t eigrp_mtu = ei->ifp->mtu - sizeof(struct ip);  	for (ALL_LIST_ELEMENTS(ei->eigrp->topology_changes_internalIPV4, node,  			       nnode, pe)) { @@ -174,7 +175,7 @@ void eigrp_send_query(struct eigrp_interface *ei)  			continue;  		if (new_packet) { -			ep = eigrp_packet_new(ei->ifp->mtu, NULL); +			ep = eigrp_packet_new(eigrp_mtu, NULL);  			/* Prepare EIGRP INIT UPDATE header */  			eigrp_packet_header_init(EIGRP_OPC_QUERY, ei->eigrp, @@ -197,7 +198,7 @@ void eigrp_send_query(struct eigrp_interface *ei)  				listnode_add(pe->rij, nbr);  		} -		if (length + EIGRP_TLV_MAX_IPV4_BYTE > (uint16_t)ei->ifp->mtu) { +		if (length + EIGRP_TLV_MAX_IPV4_BYTE > eigrp_mtu) {  			if ((ei->params.auth_type == EIGRP_AUTH_TYPE_MD5)  			    && ei->params.auth_keychain != NULL) {  				eigrp_make_md5_digest(ei, ep->s,  | 
