return 0;
}
+struct connected *
+connected_lookup_prefix_exact (struct interface *ifp, struct prefix *p)
+{
+ struct listnode *node;
+ struct listnode *next;
+ struct connected *ifc;
+
+ for (node = listhead (ifp->connected); node; node = next)
+ {
+ ifc = listgetdata (node);
+ next = node->next;
+
+ if (connected_same_prefix (ifc->address, p))
+ return ifc;
+ }
+ return NULL;
+}
+
struct connected *
connected_delete_by_prefix (struct interface *ifp, struct prefix *p)
{
struct prefix *);
extern struct connected *connected_lookup_prefix (struct interface *,
struct prefix *);
+extern struct connected *connected_lookup_prefix_exact (struct interface *,
+ struct prefix *);
extern struct nbr_connected *nbr_connected_new (void);
extern void nbr_connected_free (struct nbr_connected *);
struct nbr_connected *nbr_connected_check (struct interface *, struct prefix *);
if (type == ZEBRA_INTERFACE_ADDRESS_ADD)
{
- /* We have situations where the address may be replayed more than once.
- * Check and delete older matching address, first.
- */
- ifc = connected_delete_by_prefix(ifp, &p);
- if (ifc)
- connected_free (ifc);
-
- /* N.B. NULL destination pointers are encoded as all zeroes */
- ifc = connected_add_by_prefix(ifp, &p,(memconstant(&d.u.prefix,0,plen) ?
- NULL : &d));
- if (ifc != NULL)
+ ifc = connected_lookup_prefix_exact (ifp, &p);
+ if (!ifc)
+ {
+ /* N.B. NULL destination pointers are encoded as all zeroes */
+ ifc = connected_add_by_prefix(ifp, &p, (memconstant(&d.u.prefix,0,plen) ?
+ NULL : &d));
+ }
+ if (ifc)
{
ifc->flags = ifc_flags;
if (ifc->destination)