]> git.proxmox.com Git - mirror_frr.git/blobdiff - zebra/interface.c
isisd: implement the 'lsp-too-large' notification
[mirror_frr.git] / zebra / interface.c
index 96b244635df98c7f3c7117285adce4914604d939..ac765e7846375a2adc108155e9cd73400eb9c55d 100644 (file)
@@ -88,7 +88,7 @@ static void zebra_if_node_destroy(route_table_delegate_t *delegate,
                                  struct route_node *node)
 {
        if (node->info)
-               list_delete_and_null((struct list **)&node->info);
+               list_delete((struct list **)&node->info);
        route_node_destroy(delegate, table, node);
 }
 
@@ -174,7 +174,7 @@ static int if_zebra_delete_hook(struct interface *ifp)
                struct rtadvconf *rtadv;
 
                rtadv = &zebra_if->rtadv;
-               list_delete_and_null(&rtadv->AdvPrefixList);
+               list_delete(&rtadv->AdvPrefixList);
 #endif /* HAVE_RTADV */
 
                THREAD_OFF(zebra_if->speed_update);
@@ -361,7 +361,7 @@ int if_subnet_delete(struct interface *ifp, struct connected *ifc)
        }
 
        /* Otherwise, free list and route node. */
-       list_delete_and_null(&addr_list);
+       list_delete(&addr_list);
        rn->info = NULL;
        route_unlock_node(rn);
 
@@ -673,7 +673,7 @@ static void if_delete_connected(struct interface *ifp)
                                }
 
                        /* Free chain list and respective route node. */
-                       list_delete_and_null(&addr_list);
+                       list_delete(&addr_list);
                        rn->info = NULL;
                        route_unlock_node(rn);
                } else if (cp.family == AF_INET6) {
@@ -806,19 +806,6 @@ static void ipv6_ll_address_to_mac(struct in6_addr *address, uint8_t *mac)
        mac[5] = address->s6_addr[15];
 }
 
-static bool mac_is_same(char *mac1, char *mac2)
-{
-       if (mac1[0] == mac2[0] &&
-           mac1[1] == mac2[1] &&
-           mac1[2] == mac2[2] &&
-           mac1[3] == mac2[3] &&
-           mac1[4] == mac2[4] &&
-           mac1[5] == mac2[5])
-               return true;
-       else
-               return false;
-}
-
 void if_nbr_mac_to_ipv4ll_neigh_update(struct interface *ifp,
                                       char mac[6],
                                       struct in6_addr *address,
@@ -835,19 +822,23 @@ void if_nbr_mac_to_ipv4ll_neigh_update(struct interface *ifp,
        ns_id = zvrf->zns->ns_id;
 
        /*
-        * Remove existed arp record for the interface as netlink
-        * protocol does not have update message types
-        *
-        * supported message types are RTM_NEWNEIGH and RTM_DELNEIGH
+        * Remove and re-add any existing neighbor entry for this address,
+        * since Netlink doesn't currently offer update message types.
         */
-       if (!mac_is_same(zif->neigh_mac, mac)) {
-               kernel_neigh_update(0, ifp->ifindex, ipv4_ll.s_addr,
-                                   mac, 6, ns_id);
+       kernel_neigh_update(0, ifp->ifindex, ipv4_ll.s_addr, mac, 6, ns_id);
 
-               /* Add arp record */
-               kernel_neigh_update(add, ifp->ifindex, ipv4_ll.s_addr,
-                                   mac, 6, ns_id);
-       }
+       /* Add new neighbor entry.
+        *
+        * We force installation even if current neighbor entry is the same.
+        * Since this function is used to refresh our MAC entries after an
+        * interface flap, if we don't force in our custom entries with their
+        * state set to PERMANENT or REACHABLE then the kernel will attempt to
+        * resolve our leftover entries, fail, mark them unreachable and then
+        * they'll be useless to us.
+        */
+       if (add)
+               kernel_neigh_update(add, ifp->ifindex, ipv4_ll.s_addr, mac, 6,
+                                   ns_id);
 
        memcpy(&zif->neigh_mac[0], &mac[0], 6);
 
@@ -1150,6 +1141,15 @@ static const char *zebra_ziftype_2str(zebra_iftype_t zif_type)
                return "VETH";
                break;
 
+       case ZEBRA_IF_BOND:
+               return "bond";
+
+       case ZEBRA_IF_BOND_SLAVE:
+               return "bond_slave";
+
+       case ZEBRA_IF_MACVLAN:
+               return "macvlan";
+
        default:
                return "Unknown";
                break;
@@ -1279,6 +1279,15 @@ static void if_dump_vty(struct vty *vty, struct interface *ifp)
                                br_slave->bridge_ifindex);
        }
 
+       if (IS_ZEBRA_IF_BOND_SLAVE(ifp)) {
+               struct zebra_l2info_bondslave *bond_slave;
+
+               bond_slave = &zebra_if->bondslave_info;
+               if (bond_slave->bond_ifindex != IFINDEX_INTERNAL)
+                       vty_out(vty, "  Master (bond) ifindex %u\n",
+                               bond_slave->bond_ifindex);
+       }
+
        if (zebra_if->link_ifindex != IFINDEX_INTERNAL) {
                vty_out(vty, "  Link ifindex %u", zebra_if->link_ifindex);
                if (zebra_if->link)
@@ -2749,7 +2758,7 @@ DEFUN (no_ip_address_label,
 
 static int ipv6_address_install(struct vty *vty, struct interface *ifp,
                                const char *addr_str, const char *peer_str,
-                               const char *label, int secondary)
+                               const char *label)
 {
        struct zebra_if *if_data;
        struct prefix_ipv6 cp;
@@ -2780,10 +2789,6 @@ static int ipv6_address_install(struct vty *vty, struct interface *ifp,
                *p = cp;
                ifc->address = (struct prefix *)p;
 
-               /* Secondary. */
-               if (secondary)
-                       SET_FLAG(ifc->flags, ZEBRA_IFA_SECONDARY);
-
                /* Label. */
                if (label)
                        ifc->label = XSTRDUP(MTYPE_CONNECTED_LABEL, label);
@@ -2839,7 +2844,7 @@ int ipv6_address_configured(struct interface *ifp)
 
 static int ipv6_address_uninstall(struct vty *vty, struct interface *ifp,
                                  const char *addr_str, const char *peer_str,
-                                 const char *label, int secondry)
+                                 const char *label)
 {
        struct prefix_ipv6 cp;
        struct connected *ifc;
@@ -2897,7 +2902,7 @@ DEFUN (ipv6_address,
        int idx_ipv6_prefixlen = 2;
        VTY_DECLVAR_CONTEXT(interface, ifp);
        return ipv6_address_install(vty, ifp, argv[idx_ipv6_prefixlen]->arg,
-                                   NULL, NULL, 0);
+                                   NULL, NULL);
 }
 
 DEFUN (no_ipv6_address,
@@ -2911,7 +2916,7 @@ DEFUN (no_ipv6_address,
        int idx_ipv6_prefixlen = 3;
        VTY_DECLVAR_CONTEXT(interface, ifp);
        return ipv6_address_uninstall(vty, ifp, argv[idx_ipv6_prefixlen]->arg,
-                                     NULL, NULL, 0);
+                                     NULL, NULL);
 }
 
 static int link_params_config_write(struct vty *vty, struct interface *ifp)