diff options
| -rw-r--r-- | zebra/if_netlink.c | 5 | ||||
| -rw-r--r-- | zebra/interface.c | 3 | ||||
| -rw-r--r-- | zebra/zebra_l2.c | 18 |
3 files changed, 22 insertions, 4 deletions
diff --git a/zebra/if_netlink.c b/zebra/if_netlink.c index b2f470bc8d..c549453ef3 100644 --- a/zebra/if_netlink.c +++ b/zebra/if_netlink.c @@ -481,6 +481,11 @@ static int netlink_extract_vxlan_info(struct rtattr *link_data, vxl_info->vtep_ip = vtep_ip_in_msg; } + if (attr[IFLA_VXLAN_GROUP]) { + vxl_info->mcast_grp = + *(struct in_addr *)RTA_DATA(attr[IFLA_VXLAN_GROUP]); + } + return 0; } diff --git a/zebra/interface.c b/zebra/interface.c index 229f9c1da4..d4fc96abc2 100644 --- a/zebra/interface.c +++ b/zebra/interface.c @@ -1371,6 +1371,9 @@ static void if_dump_vty(struct vty *vty, struct interface *ifp) if (vxlan_info->access_vlan) vty_out(vty, " Access VLAN Id %u", vxlan_info->access_vlan); + if (vxlan_info->mcast_grp.s_addr != INADDR_ANY) + vty_out(vty, " Mcast %s", + inet_ntoa(vxlan_info->mcast_grp)); vty_out(vty, "\n"); } diff --git a/zebra/zebra_l2.c b/zebra/zebra_l2.c index f4b2fe4794..ca37dd748e 100644 --- a/zebra/zebra_l2.c +++ b/zebra/zebra_l2.c @@ -172,6 +172,7 @@ void zebra_l2_vxlanif_add_update(struct interface *ifp, { struct zebra_if *zif; struct in_addr old_vtep_ip; + uint16_t chgflags = 0; zif = ifp->info; assert(zif); @@ -183,11 +184,20 @@ void zebra_l2_vxlanif_add_update(struct interface *ifp, } old_vtep_ip = zif->l2info.vxl.vtep_ip; - if (IPV4_ADDR_SAME(&old_vtep_ip, &vxlan_info->vtep_ip)) - return; - zif->l2info.vxl.vtep_ip = vxlan_info->vtep_ip; - zebra_vxlan_if_update(ifp, ZEBRA_VXLIF_LOCAL_IP_CHANGE); + if (!IPV4_ADDR_SAME(&old_vtep_ip, &vxlan_info->vtep_ip)) { + chgflags |= ZEBRA_VXLIF_LOCAL_IP_CHANGE; + zif->l2info.vxl.vtep_ip = vxlan_info->vtep_ip; + } + + if (!IPV4_ADDR_SAME(&zif->l2info.vxl.mcast_grp, + &vxlan_info->mcast_grp)) { + chgflags |= ZEBRA_VXLIF_MCAST_GRP_CHANGE; + zif->l2info.vxl.mcast_grp = vxlan_info->mcast_grp; + } + + if (chgflags) + zebra_vxlan_if_update(ifp, chgflags); } /* |
