]> git.proxmox.com Git - mirror_frr.git/blobdiff - eigrpd/eigrp_interface.c
Merge pull request #11469 from donaldsharp/fdev2
[mirror_frr.git] / eigrpd / eigrp_interface.c
index 74eff958da6b7591d822bd1e143095bf227a1f5d..28987b4af65e303f0c303afedf35e1e16a0b188f 100644 (file)
 #include "eigrpd/eigrp_vty.h"
 #include "eigrpd/eigrp_network.h"
 #include "eigrpd/eigrp_topology.h"
-#include "eigrpd/eigrp_memory.h"
 #include "eigrpd/eigrp_fsm.h"
 #include "eigrpd/eigrp_dump.h"
 #include "eigrpd/eigrp_types.h"
 #include "eigrpd/eigrp_metric.h"
 
+DEFINE_MTYPE_STATIC(EIGRPD, EIGRP_IF,      "EIGRP interface");
+DEFINE_MTYPE_STATIC(EIGRPD, EIGRP_IF_INFO, "EIGRP Interface Information");
+
 struct eigrp_interface *eigrp_if_new(struct eigrp *eigrp, struct interface *ifp,
                                     struct prefix *p)
 {
@@ -229,6 +231,20 @@ void eigrp_del_if_params(struct eigrp_if_params *eip)
                free(eip->auth_keychain);
 }
 
+/*
+ * Set the network byte order of the 3 bytes we send
+ * of the mtu of the link.
+ */
+static void eigrp_mtu_convert(struct eigrp_metrics *metric, uint32_t host_mtu)
+{
+       uint32_t network_mtu = htonl(host_mtu);
+       uint8_t *nm = (uint8_t *)&network_mtu;
+
+       metric->mtu[0] = nm[1];
+       metric->mtu[1] = nm[2];
+       metric->mtu[2] = nm[3];
+}
+
 int eigrp_if_up(struct eigrp_interface *ei)
 {
        struct eigrp_prefix_descriptor *pe;
@@ -249,16 +265,14 @@ int eigrp_if_up(struct eigrp_interface *ei)
        /* Set multicast memberships appropriately for new state. */
        eigrp_if_set_multicast(ei);
 
-       thread_add_event(master, eigrp_hello_timer, ei, (1), NULL);
+       thread_add_event(master, eigrp_hello_timer, ei, (1), &ei->t_hello);
 
        /*Prepare metrics*/
        metric.bandwidth = eigrp_bandwidth_to_scaled(ei->params.bandwidth);
        metric.delay = eigrp_delay_to_scaled(ei->params.delay);
        metric.load = ei->params.load;
        metric.reliability = ei->params.reliability;
-       metric.mtu[0] = 0xDC;
-       metric.mtu[1] = 0x05;
-       metric.mtu[2] = 0x00;
+       eigrp_mtu_convert(&metric, ei->ifp->mtu);
        metric.hop_count = 0;
        metric.flags = 0;
        metric.tag = 0;