Skip to content

Commit

Permalink
zebra: keep seg6local information from 'show ipv6 route' consistent w…
Browse files Browse the repository at this point in the history
…ith iproute2

Srv6 nexthop segments may not be set when configuring seg6local
attributes. This is the case for the following seg6local route:

Dump in vtysh, extract from 'show ipv6 route'
> B>* 2001:db8:1:1:1::/128 [20/0] is directly connected, vrf1, seg6local End.DT46 table 10, seg6 ::, weight 1, 00:02:10

Dump in iproute2, extract from 'ip -6 route show'
> 2001:db8:1:1:1:: nhid 22  encap seg6local action End.DT46 vrftable 10 dev vrf1 proto bgp metric 20 pref medium

As can be seen, the 'seg6 ::' nexthop segment is not visible on iproute2,
because it is not set. Do not display seg6 ipv6 nexthop when not set.

After:
> B>* 2001:db8:1:1:1::/128 [20/0] is directly connected, vrf1, seg6local End.DT46 table 10, weight 1, 00:02:10

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
  • Loading branch information
pguibert6WIND committed Apr 14, 2023
1 parent b4bb3b1 commit f38f5c9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion zebra/zebra_rnh.c
Original file line number Diff line number Diff line change
Expand Up @@ -1538,7 +1538,9 @@ void show_route_nexthop_helper(struct vty *vty, const struct route_entry *re,
seg6local_action2str(
nexthop->nh_srv6->seg6local_action),
buf);
vty_out(vty, ", seg6 %pI6", &nexthop->nh_srv6->seg6_segs);
if (IPV6_ADDR_CMP(&nexthop->nh_srv6->seg6_segs, &in6addr_any))
vty_out(vty, ", seg6 %pI6",
&nexthop->nh_srv6->seg6_segs);
}

if (nexthop->weight)
Expand Down

0 comments on commit f38f5c9

Please sign in to comment.