summaryrefslogtreecommitdiff
path: root/eigrpd/eigrp_update.c
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2017-10-27 12:53:52 -0400
committerDonald Sharp <sharpd@cumulusnetworks.com>2017-11-02 08:10:05 -0400
commit03161b73808b856574839a95e528fc0e68baaa7d (patch)
tree11ec04eb6004fdd06935fc2faebb8dca9844589c /eigrpd/eigrp_update.c
parent453a5340a8dc1400f44d1843b8687ac750282b12 (diff)
eigrpd: Create consts for TLV size
1) Create #defines for TLV SIZE and use them 2) Speed up prefix length by using a switch statement Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Diffstat (limited to 'eigrpd/eigrp_update.c')
-rw-r--r--eigrpd/eigrp_update.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/eigrpd/eigrp_update.c b/eigrpd/eigrp_update.c
index b4d1c58870..c3eb62886a 100644
--- a/eigrpd/eigrp_update.c
+++ b/eigrpd/eigrp_update.c
@@ -560,7 +560,7 @@ void eigrp_update_send_EOT(struct eigrp_neighbor *nbr)
if (eigrp_nbr_split_horizon_check(te, ei))
continue;
- if ((length + 0x001D) > mtu) {
+ if ((length + EIGRP_TLV_MAX_IPV4_BYTE) > mtu) {
eigrp_update_place_on_nbr_queue (nbr, ep, seq_no, length);
seq_no++;
@@ -635,7 +635,8 @@ void eigrp_update_send(struct eigrp_interface *ei)
if (eigrp_nbr_split_horizon_check(ne, ei))
continue;
- if ((length + 0x001D) > (u_int16_t)ei->ifp->mtu) {
+ if ((length + EIGRP_TLV_MAX_IPV4_BYTE) >
+ (u_int16_t)ei->ifp->mtu) {
if ((ei->params.auth_type == EIGRP_AUTH_TYPE_MD5)
&& (ei->params.auth_keychain != NULL)) {
eigrp_make_md5_digest(ei, ep->s, EIGRP_AUTH_UPDATE_FLAG);