summaryrefslogtreecommitdiffstats
path: root/eigrpd/eigrp_query.c
diff options
context:
space:
mode:
authorPiotr Jurkiewicz <piotr.jerzy.jurkiewicz@gmail.com>2018-05-03 20:17:21 +0200
committerPiotr Jurkiewicz <piotr.jerzy.jurkiewicz@gmail.com>2018-05-04 02:58:18 +0200
commitca83a1ab22840a552ca746a6f65a98acba2e5e71 (patch)
tree841380cd0d81877840411acedc995c9eaa0f41a3 /eigrpd/eigrp_query.c
parentMerge pull request #2158 from donaldsharp/timeouts (diff)
downloadfrr-ca83a1ab22840a552ca746a6f65a98acba2e5e71.tar.xz
frr-ca83a1ab22840a552ca746a6f65a98acba2e5e71.zip
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.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/eigrpd/eigrp_query.c b/eigrpd/eigrp_query.c
index 00234bb35..8d13ef84d 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,