Skip to content

Commit

Permalink
nbctl: Added local link ipv6 to nbctl show.
Browse files Browse the repository at this point in the history
This commit modifies a test to deal with the changed,
response from the command
This commit also modifies the function of ovn-nbctl show,
to also return the ipv6 link local address as mentioned

This information would be useful to have with the wider useage of
advertising IPv4 Prefixes over IPv6 next hops [0]

0: https://datatracker.ietf.org/doc/html/rfc5549

Reported-at: https://launchpad.net/bugs/2069804
Signed-off-by: MJ Ponsonby <mj.ponsonby@canonical.com>
Signed-off-by: Numan Siddique <numans@ovn.org>
  • Loading branch information
crypticC0der authored and numansiddique committed Jul 11, 2024
1 parent b029669 commit ee2fa62
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions tests/ovn-nbctl.at
Original file line number Diff line number Diff line change
Expand Up @@ -1679,6 +1679,7 @@ AT_CHECK([ovn-nbctl show lr0 | uuidfilt], [0], [dnl
router <0> (lr0)
port lrp0
mac: "00:00:00:01:02:03"
ipv6-lla: "fe80::200:ff:fe01:203"
networks: [["192.168.1.1/24"]]
])

Expand Down
10 changes: 10 additions & 0 deletions utilities/ovn-nbctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -780,6 +780,16 @@ print_lr(const struct nbrec_logical_router *lr, struct ds *s)
if (lrp->mac) {
ds_put_cstr(s, " mac: ");
ds_put_format(s, "\"%s\"\n", lrp->mac);

/* Have the mac address in an array. */
struct eth_addr ea;
eth_addr_from_string(lrp->mac, &ea);
struct in6_addr lla;
in6_generate_lla(ea, &lla);

ds_put_cstr(s, " ipv6-lla: \"");
ipv6_format_addr(&lla, s);
ds_put_cstr(s, "\"\n");
}
if (lrp->n_networks) {
ds_put_cstr(s, " networks: [");
Expand Down

0 comments on commit ee2fa62

Please sign in to comment.