summaryrefslogtreecommitdiffstats
path: root/eigrpd
diff options
context:
space:
mode:
authorRuss White <russ@riw.us>2018-09-24 16:48:23 +0200
committerGitHub <noreply@github.com>2018-09-24 16:48:23 +0200
commit526da6f6383281b868f23379662d30f3c6881e69 (patch)
tree5751e1a1aa53eae198061ff1e9c73534bc3718f6 /eigrpd
parentMerge pull request #3073 from donaldsharp/pid_cleanup (diff)
parenteigrpd: Fix eigrp crash on shut of a interface (diff)
downloadfrr-526da6f6383281b868f23379662d30f3c6881e69.tar.xz
frr-526da6f6383281b868f23379662d30f3c6881e69.zip
Merge pull request #3072 from donaldsharp/fix_eigrp_crash_on_int_shut
eigrpd: Fix eigrp crash on shut of a interface
Diffstat (limited to 'eigrpd')
-rw-r--r--eigrpd/eigrp_interface.c6
-rw-r--r--eigrpd/eigrp_network.c20
-rw-r--r--eigrpd/eigrp_structs.h1
3 files changed, 11 insertions, 16 deletions
diff --git a/eigrpd/eigrp_interface.c b/eigrpd/eigrp_interface.c
index cd62811fd..913db684c 100644
--- a/eigrpd/eigrp_interface.c
+++ b/eigrpd/eigrp_interface.c
@@ -183,9 +183,7 @@ int eigrp_if_up(struct eigrp_interface *ei)
struct prefix dest_addr;
- dest_addr.family = AF_INET;
- dest_addr.u.prefix4 = ei->connected->address->u.prefix4;
- dest_addr.prefixlen = ei->connected->address->prefixlen;
+ dest_addr = *ei->address;
apply_mask(&dest_addr);
pe = eigrp_topology_table_lookup_ipv4(eigrp->topology_table,
&dest_addr);
@@ -344,7 +342,7 @@ void eigrp_if_free(struct eigrp_interface *ei, int source)
eigrp_hello_send(ei, EIGRP_HELLO_GRACEFUL_SHUTDOWN, NULL);
}
- dest_addr = *ei->connected->address;
+ dest_addr = *ei->address;
apply_mask(&dest_addr);
pe = eigrp_topology_table_lookup_ipv4(eigrp->topology_table,
&dest_addr);
diff --git a/eigrpd/eigrp_network.c b/eigrpd/eigrp_network.c
index 8eaf1e82a..35b45288b 100644
--- a/eigrpd/eigrp_network.c
+++ b/eigrpd/eigrp_network.c
@@ -48,8 +48,8 @@
#include "eigrpd/eigrp_vty.h"
#include "eigrpd/eigrp_network.h"
-static int eigrp_network_match_iface(const struct connected *,
- const struct prefix *);
+static int eigrp_network_match_iface(const struct prefix *connected_prefix,
+ const struct prefix *prefix);
static void eigrp_network_run_interface(struct eigrp *, struct prefix *,
struct interface *);
@@ -241,11 +241,11 @@ int eigrp_network_set(struct eigrp *eigrp, struct prefix *p)
/* Check whether interface matches given network
* returns: 1, true. 0, false
*/
-static int eigrp_network_match_iface(const struct connected *co,
+static int eigrp_network_match_iface(const struct prefix *co_prefix,
const struct prefix *net)
{
/* new approach: more elegant and conceptually clean */
- return prefix_match_network_statement(net, CONNECTED_PREFIX(co));
+ return prefix_match_network_statement(net, co_prefix);
}
static void eigrp_network_run_interface(struct eigrp *eigrp, struct prefix *p,
@@ -263,10 +263,9 @@ static void eigrp_network_run_interface(struct eigrp *eigrp, struct prefix *p,
continue;
if (p->family == co->address->family && !ifp->info
- && eigrp_network_match_iface(co, p)) {
+ && eigrp_network_match_iface(co->address, p)) {
ei = eigrp_if_new(eigrp, ifp, co->address);
- ei->connected = co;
/* Relate eigrp interface to eigrp instance. */
ei->eigrp = eigrp;
@@ -328,21 +327,20 @@ int eigrp_network_unset(struct eigrp *eigrp, struct prefix *p)
/* Find interfaces that not configured already. */
for (ALL_LIST_ELEMENTS(eigrp->eiflist, node, nnode, ei)) {
- int found = 0;
- struct connected *co = ei->connected;
+ bool found = false;
for (rn = route_top(eigrp->networks); rn; rn = route_next(rn)) {
if (rn->info == NULL)
continue;
- if (eigrp_network_match_iface(co, &rn->p)) {
- found = 1;
+ if (eigrp_network_match_iface(ei->address, &rn->p)) {
+ found = true;
route_unlock_node(rn);
break;
}
}
- if (found == 0) {
+ if (!found) {
eigrp_if_free(ei, INTERFACE_DOWN_BY_VTY);
}
}
diff --git a/eigrpd/eigrp_structs.h b/eigrpd/eigrp_structs.h
index 95bcfe50e..ce03a21fb 100644
--- a/eigrpd/eigrp_structs.h
+++ b/eigrpd/eigrp_structs.h
@@ -178,7 +178,6 @@ struct eigrp_interface {
uint8_t type;
struct prefix *address; /* Interface prefix */
- struct connected *connected; /* Pointer to connected */
/* Neighbor information. */
struct list *nbrs; /* EIGRP Neighbor List */