diff options
| author | Donald Sharp <sharpd@cumulusnetworks.com> | 2020-09-02 08:25:09 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-09-02 08:25:09 -0400 |
| commit | b0d39af982854de9fcad7960804b8ca82a664158 (patch) | |
| tree | 068802be000e463be3550cbbba73c5525400adbc /ospf6d/ospf6_route.c | |
| parent | 4223956546963c3f1a918efc6d3a5c0da875c7e7 (diff) | |
| parent | c5d28568c6b71e16fefb3a409159e8fc9742e3f0 (diff) | |
Merge pull request #7027 from Niral-Networks/niral_dev_vrf_ospf6
ospf6d : Preparing for ospf6d VRF support.
Diffstat (limited to 'ospf6d/ospf6_route.c')
| -rw-r--r-- | ospf6d/ospf6_route.c | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/ospf6d/ospf6_route.c b/ospf6d/ospf6_route.c index 723746c471..a443e4c3ba 100644 --- a/ospf6d/ospf6_route.c +++ b/ospf6d/ospf6_route.c @@ -307,14 +307,14 @@ void ospf6_route_zebra_copy_nexthops(struct ospf6_route *route, inet_ntop(AF_INET6, &nh->address, buf, sizeof(buf)); ifname = ifindex2ifname(nh->ifindex, - VRF_DEFAULT); + ospf6->vrf_id); zlog_debug(" nexthop: %s%%%.*s(%d)", buf, IFNAMSIZ, ifname, nh->ifindex); } if (i >= entries) return; - nexthops[i].vrf_id = VRF_DEFAULT; + nexthops[i].vrf_id = ospf6->vrf_id; nexthops[i].ifindex = nh->ifindex; if (!IN6_IS_ADDR_UNSPECIFIED(&nh->address)) { nexthops[i].gate.ipv6 = nh->address; @@ -1042,6 +1042,11 @@ void ospf6_route_show(struct vty *vty, struct ospf6_route *route) struct listnode *node; struct ospf6_nexthop *nh; + if (ospf6 == NULL) { + vty_out(vty, "OSPFv3 is not running\n"); + return; + } + monotime(&now); timersub(&now, &route->changed, &res); timerstring(&res, duration, sizeof(duration)); @@ -1060,7 +1065,7 @@ void ospf6_route_show(struct vty *vty, struct ospf6_route *route) for (ALL_LIST_ELEMENTS_RO(route->nh_list, node, nh)) { /* nexthop */ inet_ntop(AF_INET6, &nh->address, nexthop, sizeof(nexthop)); - ifname = ifindex2ifname(nh->ifindex, VRF_DEFAULT); + ifname = ifindex2ifname(nh->ifindex, ospf6->vrf_id); if (!i) { vty_out(vty, "%c%1s %2s %-30s %-25s %6.*s %s\n", @@ -1086,6 +1091,11 @@ void ospf6_route_show_detail(struct vty *vty, struct ospf6_route *route) struct listnode *node; struct ospf6_nexthop *nh; + if (ospf6 == NULL) { + vty_out(vty, "OSPFv3 is not running\n"); + return; + } + monotime(&now); /* destination */ @@ -1160,7 +1170,7 @@ void ospf6_route_show_detail(struct vty *vty, struct ospf6_route *route) for (ALL_LIST_ELEMENTS_RO(route->nh_list, node, nh)) { /* nexthop */ inet_ntop(AF_INET6, &nh->address, nexthop, sizeof(nexthop)); - ifname = ifindex2ifname(nh->ifindex, VRF_DEFAULT); + ifname = ifindex2ifname(nh->ifindex, ospf6->vrf_id); vty_out(vty, " %s %.*s\n", nexthop, IFNAMSIZ, ifname); } vty_out(vty, "\n"); |
