summaryrefslogtreecommitdiffstats
path: root/zebra/rt_netlink.c
diff options
context:
space:
mode:
Diffstat (limited to 'zebra/rt_netlink.c')
-rw-r--r--zebra/rt_netlink.c44
1 files changed, 24 insertions, 20 deletions
diff --git a/zebra/rt_netlink.c b/zebra/rt_netlink.c
index b794f18a..2fb72f4c 100644
--- a/zebra/rt_netlink.c
+++ b/zebra/rt_netlink.c
@@ -1015,7 +1015,7 @@ netlink_link_change (struct sockaddr_nl *snl, struct nlmsghdr *h)
/* Add interface. */
if (h->nlmsg_type == RTM_NEWLINK)
{
- unsigned long flag = ifi->ifi_flags & 0x0000fffff;
+ unsigned long new_flags = ifi->ifi_flags & 0x0000fffff;
ifp = if_lookup_by_name (name);
if (ifp == NULL || !CHECK_FLAG (ifp->status, ZEBRA_INTERFACE_ACTIVE))
@@ -1024,10 +1024,10 @@ netlink_link_change (struct sockaddr_nl *snl, struct nlmsghdr *h)
ifp = if_get_by_name (name);
zlog_info ("interface %s index %d %s added.",
- name, ifi->ifi_index, if_flag_dump(flag));
+ name, ifi->ifi_index, if_flag_dump(new_flags));
set_ifindex(ifp, ifi->ifi_index);
- ifp->flags = flag;
+ ifp->flags = new_flags;
ifp->mtu6 = ifp->mtu = *(int *) RTA_DATA (tb[IFLA_MTU]);
ifp->metric = 1;
@@ -1041,28 +1041,32 @@ netlink_link_change (struct sockaddr_nl *snl, struct nlmsghdr *h)
ifp->mtu6 = ifp->mtu = *(int *) RTA_DATA (tb[IFLA_MTU]);
ifp->metric = 1;
- zlog_info ("interface %s index %d changed %s.",
- name, ifi->ifi_index, if_flag_dump(flag));
- if (if_is_operative (ifp))
- {
- ifp->flags = flag;
- if (!if_is_operative (ifp))
- if_down (ifp);
+ if (new_flags != ifp->flags)
+ {
+ zlog_info ("interface %s index %d changed %s.",
+ name, ifi->ifi_index, if_flag_dump(new_flags));
+
+ if (if_is_operative (ifp))
+ {
+ ifp->flags = new_flags;
+ if (!if_is_operative (ifp))
+ if_down (ifp);
+ else
+ /* Must notify client daemons of new interface status. */
+ zebra_interface_up_update (ifp);
+ }
else
- /* Must notify client daemons of new interface status. */
- zebra_interface_up_update (ifp);
- }
- else
- {
- ifp->flags = ifi->ifi_flags & 0x0000fffff;
- if (if_is_operative (ifp))
- if_up (ifp);
- }
+ {
+ ifp->flags = new_flags;
+ if (if_is_operative (ifp))
+ if_up (ifp);
+ }
+ }
}
}
else
{
- // RTM_DELLINK.
+ // RTM_DELLINK.
ifp = if_lookup_by_name (name);
if (ifp == NULL)