diff --git a/eigrpd/eigrp_dump.c b/eigrpd/eigrp_dump.c index 27e02630a655..c975c0abc7b6 100644 --- a/eigrpd/eigrp_dump.c +++ b/eigrpd/eigrp_dump.c @@ -276,11 +276,8 @@ void show_ip_eigrp_neighbor_sub(struct vty *vty, struct eigrp_neighbor *nbr, */ void show_ip_eigrp_topology_header(struct vty *vty, struct eigrp *eigrp) { - struct in_addr router_id; - router_id.s_addr = eigrp->router_id; - vty_out(vty, "\nEIGRP Topology Table for AS(%d)/ID(%s)\n\n", eigrp->AS, - inet_ntoa(router_id)); + inet_ntoa(eigrp->router_id)); vty_out(vty, "Codes: P - Passive, A - Active, U - Update, Q - Query, " "R - Reply\n r - reply Status, s - sia Status\n\n"); diff --git a/eigrpd/eigrp_network.c b/eigrpd/eigrp_network.c index 35b45288b80f..6bb619f0e195 100644 --- a/eigrpd/eigrp_network.c +++ b/eigrpd/eigrp_network.c @@ -227,7 +227,7 @@ int eigrp_network_set(struct eigrp *eigrp, struct prefix *p) rn->info = (void *)pref; /* Schedule Router ID Update. */ - if (eigrp->router_id == 0) + if (eigrp->router_id.s_addr == 0) eigrp_router_id_update(eigrp); /* Run network config now. */ /* Get target interface. */ @@ -293,7 +293,7 @@ void eigrp_if_update(struct interface *ifp) */ for (ALL_LIST_ELEMENTS(eigrp_om->eigrp, node, nnode, eigrp)) { /* EIGRP must be on and Router-ID must be configured. */ - if (!eigrp || eigrp->router_id == 0) + if (!eigrp || eigrp->router_id.s_addr == 0) continue; /* Run each network for this interface. */ diff --git a/eigrpd/eigrp_structs.h b/eigrpd/eigrp_structs.h index ce03a21fbaeb..f661d9ec581b 100644 --- a/eigrpd/eigrp_structs.h +++ b/eigrpd/eigrp_structs.h @@ -79,8 +79,8 @@ struct eigrp { char *name; /* EIGRP Router ID. */ - uint32_t router_id; /* Configured automatically. */ - uint32_t router_id_static; /* Configured manually. */ + struct in_addr router_id; /* Configured automatically. */ + struct in_addr router_id_static; /* Configured manually. */ struct list *eiflist; /* eigrp interfaces */ uint8_t passive_interface_default; /* passive-interface default */ diff --git a/eigrpd/eigrp_vty.c b/eigrpd/eigrp_vty.c index 89dd0035e6f5..7baf7b9f6bc1 100644 --- a/eigrpd/eigrp_vty.c +++ b/eigrpd/eigrp_vty.c @@ -192,11 +192,9 @@ static int config_write_eigrp_router(struct vty *vty, struct eigrp *eigrp) write++; /* Router ID print. */ - if (eigrp->router_id_static != 0) { - struct in_addr router_id_static; - router_id_static.s_addr = htonl(eigrp->router_id_static); + if (eigrp->router_id_static.s_addr != 0) { vty_out(vty, " eigrp router-id %s\n", - inet_ntoa(router_id_static)); + inet_ntoa(eigrp->router_id_static)); } /* Network area print. */ diff --git a/eigrpd/eigrpd.c b/eigrpd/eigrpd.c index 9bbecdf9e39d..2b2293f24f4c 100644 --- a/eigrpd/eigrpd.c +++ b/eigrpd/eigrpd.c @@ -95,21 +95,21 @@ void eigrp_router_id_update(struct eigrp *eigrp) { struct vrf *vrf = vrf_lookup_by_id(VRF_DEFAULT); struct interface *ifp; - uint32_t router_id, router_id_old; + struct in_addr router_id, router_id_old; router_id_old = eigrp->router_id; - if (eigrp->router_id_static != 0) + if (eigrp->router_id_static.s_addr != 0) router_id = eigrp->router_id_static; - else if (eigrp->router_id != 0) + else if (eigrp->router_id.s_addr != 0) router_id = eigrp->router_id; else - router_id = router_id_zebra.s_addr; + router_id = router_id_zebra; eigrp->router_id = router_id; - if (router_id_old != router_id) { + if (router_id_old.s_addr != router_id.s_addr) { // if (IS_DEBUG_EIGRP_EVENT) // zlog_debug("Router-ID[NEW:%s]: Update", // inet_ntoa(eigrp->router_id)); @@ -142,8 +142,8 @@ static struct eigrp *eigrp_new(const char *AS) /* init information relevant to peers */ eigrp->vrid = 0; eigrp->AS = atoi(AS); - eigrp->router_id = 0L; - eigrp->router_id_static = 0L; + eigrp->router_id.s_addr = 0; + eigrp->router_id_static.s_addr = 0; eigrp->sequence_number = 1; /*Configure default K Values for EIGRP Process*/