int
prefix_same (const struct prefix *p1, const struct prefix *p2)
{
+ if ((p1 && !p2) || (!p1 && p2))
+ return 0;
+
+ if (!p1 && !p2)
+ return 1;
+
if (p1->family == p2->family && p1->prefixlen == p2->prefixlen)
{
if (p1->family == AF_INET)
char bufs[INET6_ADDRSTRLEN];
struct route_node *static_rn;
struct nexthop *nexthop;
+
ntable = lookup_rnh_table(vrfid, family);
if (!ntable)
{
state_changed = 0;
- if (compare_state(rib, rnh->state))
+ /* Ensure prefixes we're resolving over have stayed the same */
+ if (!prefix_same(&rnh->resolved_route, &prn->p))
+ {
+ if (rib)
+ UNSET_FLAG(rib->status, RIB_ENTRY_NEXTHOPS_CHANGED);
+
+ if (prn)
+ prefix_copy(&rnh->resolved_route, &prn->p);
+ else
+ memset(&rnh->resolved_route, 0, sizeof(struct prefix));
+
+ copy_state(rnh, rib, nrn);
+ state_changed = 1;
+ }
+ else if (compare_state(rib, rnh->state))
{
if (rib)
UNSET_FLAG(rib->status, RIB_ENTRY_NEXTHOPS_CHANGED);
#define ZEBRA_NHT_CONNECTED 0x1
#define ZEBRA_NHT_DELETED 0x2
struct rib *state;
+ struct prefix resolved_route;
struct list *client_list;
struct list *zebra_static_route_list; /* static routes dependent on this NH */
struct route_node *node;