mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-04-29 08:07:35 +00:00
zebra: Update rib_add to take a nexthop ID
Add a parameter to the rib_add function so that it takes a nexthop ID from the kernel if one is passed along with the route. Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
This commit is contained in:
parent
77a44d94f8
commit
8032b71737
@ -251,10 +251,10 @@ void connected_up(struct interface *ifp, struct connected *ifc)
|
||||
metric = (ifc->metric < (uint32_t)METRIC_MAX) ?
|
||||
ifc->metric : ifp->metric;
|
||||
rib_add(afi, SAFI_UNICAST, zvrf->vrf->vrf_id, ZEBRA_ROUTE_CONNECT,
|
||||
0, 0, &p, NULL, &nh, zvrf->table_id, metric, 0, 0, 0);
|
||||
0, 0, &p, NULL, &nh, 0, zvrf->table_id, metric, 0, 0, 0);
|
||||
|
||||
rib_add(afi, SAFI_MULTICAST, zvrf->vrf->vrf_id, ZEBRA_ROUTE_CONNECT,
|
||||
0, 0, &p, NULL, &nh, zvrf->table_id, metric, 0, 0, 0);
|
||||
0, 0, &p, NULL, &nh, 0, zvrf->table_id, metric, 0, 0, 0);
|
||||
|
||||
/* Schedule LSP forwarding entries for processing, if appropriate. */
|
||||
if (zvrf->vrf->vrf_id == VRF_DEFAULT) {
|
||||
|
@ -1144,7 +1144,8 @@ void rtm_read(struct rt_msghdr *rtm)
|
||||
if (rtm->rtm_type == RTM_GET || rtm->rtm_type == RTM_ADD
|
||||
|| rtm->rtm_type == RTM_CHANGE)
|
||||
rib_add(afi, SAFI_UNICAST, VRF_DEFAULT, ZEBRA_ROUTE_KERNEL, 0,
|
||||
zebra_flags, &p, NULL, &nh, RT_TABLE_MAIN, 0, 0, 0, 0);
|
||||
zebra_flags, &p, NULL, &nh, 0, RT_TABLE_MAIN,
|
||||
0, 0, 0, 0);
|
||||
else
|
||||
rib_delete(afi, SAFI_UNICAST, VRF_DEFAULT, ZEBRA_ROUTE_KERNEL,
|
||||
0, zebra_flags, &p, NULL, &nh, RT_TABLE_MAIN,
|
||||
|
@ -363,8 +363,8 @@ extern void rib_uninstall_kernel(struct route_node *rn, struct route_entry *re);
|
||||
extern int rib_add(afi_t afi, safi_t safi, vrf_id_t vrf_id, int type,
|
||||
unsigned short instance, int flags, struct prefix *p,
|
||||
struct prefix_ipv6 *src_p, const struct nexthop *nh,
|
||||
uint32_t table_id, uint32_t metric, uint32_t mtu,
|
||||
uint8_t distance, route_tag_t tag);
|
||||
uint32_t nhe_id, uint32_t table_id, uint32_t metric,
|
||||
uint32_t mtu, uint8_t distance, route_tag_t tag);
|
||||
|
||||
extern int rib_add_multipath(afi_t afi, safi_t safi, struct prefix *p,
|
||||
struct prefix_ipv6 *src_p, struct route_entry *re);
|
||||
|
@ -618,7 +618,8 @@ static int netlink_route_change_read_unicast(struct nlmsghdr *h, ns_id_t ns_id,
|
||||
gate, afi, nh_vrf_id);
|
||||
}
|
||||
rib_add(afi, SAFI_UNICAST, vrf_id, proto, 0, flags, &p,
|
||||
&src_p, &nh, table, metric, mtu, distance, tag);
|
||||
&src_p, &nh, nhe_id, table, metric, mtu,
|
||||
distance, tag);
|
||||
} else {
|
||||
/* This is a multipath route */
|
||||
uint8_t nhop_num;
|
||||
|
@ -102,7 +102,7 @@ static void handle_route_entry(mib2_ipRouteEntry_t *routeEntry)
|
||||
nh.gate.ipv4.s_addr = routeEntry->ipRouteNextHop;
|
||||
|
||||
rib_add(AFI_IP, SAFI_UNICAST, VRF_DEFAULT, ZEBRA_ROUTE_KERNEL, 0,
|
||||
zebra_flags, &prefix, NULL, &nh, 0, 0, 0, 0, 0);
|
||||
zebra_flags, &prefix, NULL, &nh, 0, 0, 0, 0, 0, 0);
|
||||
}
|
||||
|
||||
void route_read(struct zebra_ns *zns)
|
||||
|
@ -2947,8 +2947,8 @@ void rib_delete(afi_t afi, safi_t safi, vrf_id_t vrf_id, int type,
|
||||
int rib_add(afi_t afi, safi_t safi, vrf_id_t vrf_id, int type,
|
||||
unsigned short instance, int flags, struct prefix *p,
|
||||
struct prefix_ipv6 *src_p, const struct nexthop *nh,
|
||||
uint32_t table_id, uint32_t metric, uint32_t mtu, uint8_t distance,
|
||||
route_tag_t tag)
|
||||
uint32_t nhe_id, uint32_t table_id, uint32_t metric, uint32_t mtu,
|
||||
uint8_t distance, route_tag_t tag)
|
||||
{
|
||||
struct route_entry *re;
|
||||
struct nexthop *nexthop;
|
||||
|
Loading…
Reference in New Issue
Block a user