Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions interface.c
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ int
flush_interface(char *ifname)
{
struct interface *ifp, *prev;
struct neighbour *neigh;

prev = NULL;
ifp = interfaces;
Expand All @@ -114,6 +115,18 @@ flush_interface(char *ifname)
if(ifp == NULL)
return 0;

/* flush any neighbours associated with interface */
neigh = neighs;
while(neigh) {
if(neigh->ifp == ifp) {
struct neighbour *old = neigh;
neigh = neigh->next;
flush_neighbour(old);
continue;
}
neigh = neigh->next;
}

interface_updown(ifp, 0);
if(prev)
prev->next = ifp->next;
Expand Down
2 changes: 1 addition & 1 deletion neighbour.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ find_neighbour_nocreate(const unsigned char *address, struct interface *ifp)
return NULL;
}

static void
void
flush_neighbour(struct neighbour *neigh)
{
flush_neighbour_routes(neigh);
Expand Down
1 change: 1 addition & 0 deletions neighbour.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ struct neighbour *find_neighbour(const unsigned char *address,
int update_neighbour(struct neighbour *neigh, struct hello_history *hist,
int unicast, int hello, int hello_interval);
unsigned check_neighbours(void);
void flush_neighbour(struct neighbour *neigh);
unsigned neighbour_txcost(struct neighbour *neigh);
unsigned neighbour_rxcost(struct neighbour *neigh);
unsigned neighbour_rttcost(struct neighbour *neigh);
Expand Down