]> git.proxmox.com Git - mirror_frr.git/blobdiff - zebra/connected.c
Merge pull request #1059 from opensourcerouting/oldbits-1
[mirror_frr.git] / zebra / connected.c
index 387ad9c41da3bcdfe234abb671bc016b1137f06f..c97962647cc887b4bf18b5415412d0e03e9526f4 100644 (file)
@@ -207,6 +207,10 @@ static void connected_update(struct interface *ifp, struct connected *ifc)
 void connected_up_ipv4(struct interface *ifp, struct connected *ifc)
 {
        struct prefix p;
+       struct nexthop nh = {
+               .type = NEXTHOP_TYPE_IFINDEX,
+               .ifindex = ifp->ifindex,
+       };
 
        if (!CHECK_FLAG(ifc->conf, ZEBRA_IFC_REAL))
                return;
@@ -222,12 +226,10 @@ void connected_up_ipv4(struct interface *ifp, struct connected *ifc)
                return;
 
        rib_add(AFI_IP, SAFI_UNICAST, ifp->vrf_id, ZEBRA_ROUTE_CONNECT, 0, 0,
-               &p, NULL, NULL, NULL, ifp->ifindex, RT_TABLE_MAIN, ifp->metric,
-               0, 0);
+               &p, NULL, &nh, RT_TABLE_MAIN, ifp->metric, 0, 0);
 
        rib_add(AFI_IP, SAFI_MULTICAST, ifp->vrf_id, ZEBRA_ROUTE_CONNECT, 0, 0,
-               &p, NULL, NULL, NULL, ifp->ifindex, RT_TABLE_MAIN, ifp->metric,
-               0, 0);
+               &p, NULL, &nh, RT_TABLE_MAIN, ifp->metric, 0, 0);
 
        if (IS_ZEBRA_DEBUG_RIB_DETAILED)
                zlog_debug(
@@ -337,6 +339,10 @@ void connected_add_ipv4(struct interface *ifp, int flags, struct in_addr *addr,
 void connected_down_ipv4(struct interface *ifp, struct connected *ifc)
 {
        struct prefix p;
+       struct nexthop nh = {
+               .type = NEXTHOP_TYPE_IFINDEX,
+               .ifindex = ifp->ifindex,
+       };
 
        if (!CHECK_FLAG(ifc->conf, ZEBRA_IFC_REAL))
                return;
@@ -354,10 +360,10 @@ void connected_down_ipv4(struct interface *ifp, struct connected *ifc)
        /* Same logic as for connected_up_ipv4(): push the changes into the
         * head. */
        rib_delete(AFI_IP, SAFI_UNICAST, ifp->vrf_id, ZEBRA_ROUTE_CONNECT, 0, 0,
-                  &p, NULL, NULL, ifp->ifindex, 0, 0);
+                  &p, NULL, &nh, 0, 0);
 
        rib_delete(AFI_IP, SAFI_MULTICAST, ifp->vrf_id, ZEBRA_ROUTE_CONNECT, 0,
-                  0, &p, NULL, NULL, ifp->ifindex, 0, 0);
+                  0, &p, NULL, &nh, 0, 0);
 
        if (IS_ZEBRA_DEBUG_RIB_DETAILED)
                zlog_debug(
@@ -425,6 +431,10 @@ void connected_delete_ipv4(struct interface *ifp, int flags,
 void connected_up_ipv6(struct interface *ifp, struct connected *ifc)
 {
        struct prefix p;
+       struct nexthop nh = {
+               .type = NEXTHOP_TYPE_IFINDEX,
+               .ifindex = ifp->ifindex,
+       };
 
        if (!CHECK_FLAG(ifc->conf, ZEBRA_IFC_REAL))
                return;
@@ -441,8 +451,7 @@ void connected_up_ipv6(struct interface *ifp, struct connected *ifc)
 #endif
 
        rib_add(AFI_IP6, SAFI_UNICAST, ifp->vrf_id, ZEBRA_ROUTE_CONNECT, 0, 0,
-               &p, NULL, NULL, NULL, ifp->ifindex, RT_TABLE_MAIN, ifp->metric,
-               0, 0);
+               &p, NULL, &nh, RT_TABLE_MAIN, ifp->metric, 0, 0);
 
        if (IS_ZEBRA_DEBUG_RIB_DETAILED)
                zlog_debug(
@@ -506,6 +515,10 @@ void connected_add_ipv6(struct interface *ifp, int flags, struct in6_addr *addr,
 void connected_down_ipv6(struct interface *ifp, struct connected *ifc)
 {
        struct prefix p;
+       struct nexthop nh = {
+               .type = NEXTHOP_TYPE_IFINDEX,
+               .ifindex = ifp->ifindex,
+       };
 
        if (!CHECK_FLAG(ifc->conf, ZEBRA_IFC_REAL))
                return;
@@ -518,7 +531,7 @@ void connected_down_ipv6(struct interface *ifp, struct connected *ifc)
                return;
 
        rib_delete(AFI_IP6, SAFI_UNICAST, ifp->vrf_id, ZEBRA_ROUTE_CONNECT, 0,
-                  0, &p, NULL, NULL, ifp->ifindex, 0, 0);
+                  0, &p, NULL, &nh, 0, 0);
 
        if (IS_ZEBRA_DEBUG_RIB_DETAILED)
                zlog_debug(