<div dir="ltr">
<div>Hello!</div><div>In CLI command line, after 'configure' command, pointer to static routes in neighbor structure not valid.</div><div><br></div><div><br></div><div><br></div><div>This patch delete heighbors.
<span class="gmail-m_-49911581973368596gmail-m_6570558204722623327gmail-tlid-translation gmail-m_-49911581973368596gmail-m_6570558204722623327gmail-translation"><span title="" class="gmail-m_-49911581973368596gmail-m_6570558204722623327gmail-">Perhaps there is a better solution.</span></span>
</div><div><br></div><div>diff --git a/nest/neighbor.c b/nest/neighbor.c<br>index f8159d3..7fc449a 100644<br>--- a/nest/neighbor.c<br>+++ b/nest/neighbor.c<br>@@ -379,6 +379,37 @@ neigh_prune_one(neighbor *n)<br> sl_free(neigh_slab, n);<br> }<br>.<br>+<br>+void<br>+neigh_prune_proto(struct proto *p)<br>+{<br>+ neighbor *n;<br>+ node *m;<br>+ int i;<br>+<br>+ for(i=0; i<NEIGH_HASH_SIZE; i++)<br>+ WALK_LIST_DELSAFE(n, m, neigh_hash_table[i])<br>+ if (n->proto == p )<br>+ {<br>+ rem_node(&n->n);<br>+ if (n->scope >= 0)<br>+ rem_node(&n->if_n);<br>+ sl_free(neigh_slab, n);<br>+ }<br>+ WALK_LIST_DELSAFE(n, m, sticky_neigh_list)<br>+ if (n->proto == p )<br>+ {<br>+ rem_node(&n->n);<br>+ if (n->scope >= 0)<br>+ rem_node(&n->if_n);<br>+ sl_free(neigh_slab, n);<br>+ }<br>+}<br>+<br>+<br>+<br>+<br>+<br> /**<br> * neigh_prune - prune neighbor cache<br> *<br>diff --git a/proto/static/static.c b/proto/static/static.c<br>index 849067b..8a7d1a0 100644<br>--- a/proto/static/static.c<br>+++ b/proto/static/static.c<br>@@ -559,6 +559,8 @@ static_reconfigure(struct proto *p, struct proto_config *new)<br> WALK_LIST(r, o->other_routes)<br> static_match(p, r, n);<br>.<br>+ neigh_prune_proto(p);<br>+<br> /* Now add all new routes, those not changed will be ignored by static_install() */<br> WALK_LIST(r, n->iface_routes)<br> {</div>
</div>