Message ID | 20240705164047.8326-1-mj.ponsonby@canonical.com |
---|---|
State | Accepted |
Headers | show |
Series | [ovs-dev,v2] nbctl: Added local link ipv6 to nbctl show. | expand |
Context | Check | Description |
---|---|---|
ovsrobot/apply-robot | success | apply and check: success |
ovsrobot/github-robot-_Build_and_Test | success | github build: passed |
ovsrobot/github-robot-_ovn-kubernetes | success | github build: passed |
On Fri, Jul 5, 2024 at 12:41 PM Mj Ponsonby <mj.ponsonby@canonical.com> wrote: > > From: MJ Ponsonby <mj.ponsonby@canonical.com> > > > 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> Thanks. Applied to main. Numan > --- > tests/ovn-nbctl.at | 1 + > utilities/ovn-nbctl.c | 10 ++++++++++ > 2 files changed, 11 insertions(+) > > diff --git a/tests/ovn-nbctl.at b/tests/ovn-nbctl.at > index 19c83a4a5..de014e1f9 100644 > --- a/tests/ovn-nbctl.at > +++ b/tests/ovn-nbctl.at > @@ -1670,6 +1670,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"]] > ]) > > diff --git a/utilities/ovn-nbctl.c b/utilities/ovn-nbctl.c > index 32ca4f750..04c123022 100644 > --- a/utilities/ovn-nbctl.c > +++ b/utilities/ovn-nbctl.c > @@ -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: ["); > -- > 2.43.0 > > _______________________________________________ > dev mailing list > dev@openvswitch.org > https://mail.openvswitch.org/mailman/listinfo/ovs-dev >
diff --git a/tests/ovn-nbctl.at b/tests/ovn-nbctl.at index 19c83a4a5..de014e1f9 100644 --- a/tests/ovn-nbctl.at +++ b/tests/ovn-nbctl.at @@ -1670,6 +1670,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"]] ]) diff --git a/utilities/ovn-nbctl.c b/utilities/ovn-nbctl.c index 32ca4f750..04c123022 100644 --- a/utilities/ovn-nbctl.c +++ b/utilities/ovn-nbctl.c @@ -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: [");