c |= IF_CHANGE_LINK;
if (i->mtu != j->mtu)
c |= IF_CHANGE_MTU;
+ if (i->attrs != j->attrs)
+ c |= IF_CHANGE_ATTRS;
return c;
}
to->mtu = from->mtu;
to->master_index = from->master_index;
to->master = from->master;
+ to->attrs = from->attrs;
}
static inline void
struct iface *i;
unsigned c;
+ if (new->attrs && !rta_is_cached(new->attrs))
+ new->attrs = new->attrs->eattrs ? rta_lookup(new->attrs) : NULL;
+
WALK_LIST(i, iface_list)
if (!strcmp(new->name, i->name))
{
new->llv6 = i->llv6;
new->sysdep = i->sysdep;
memcpy(&new->addrs, &i->addrs, sizeof(i->addrs));
+ rta_free(i->attrs);
memcpy(i, new, sizeof(*i));
i->flags &= ~IF_UP; /* IF_TMP_DOWN will be added later */
goto newif;
}
+ rta_free(i->attrs);
if_copy(i, new);
if (c)
if_notify_change(c, i);
struct ifa *llv6; /* Primary link-local address for IPv6 */
ip4_addr sysdep; /* Arbitrary IPv4 address for internal sysdep use */
list neighbors; /* All neighbors on this interface */
+ struct rta *attrs;
};
#define IF_UP 1 /* Currently just IF_ADMIN_UP */
#define IF_CHANGE_ADDR6 0x200 /* ... */
#define IF_CHANGE_LLV6 0x400
#define IF_CHANGE_SYSDEP 0x800
+#define IF_CHANGE_ATTRS 0x1000
#define IF_CHANGE_TOO_MUCH 0x40000000 /* Used internally */
#define IF_CHANGE_UPDOWN (IF_CHANGE_UP | IF_CHANGE_DOWN)
struct ifinfomsg *i;
struct rtattr *a[BIRD_IFLA_MAX];
int new = h->nlmsg_type == RTM_NEWLINK;
- struct iface f = {};
+ struct rta rta = { 0 };
+ struct iface f = { .attrs = &rta };
struct iface *ifi;
const char *name, *kind = NULL;
u32 mtu, master = 0;