Reported-at: https://launchpad.net/bugs/2069804

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

Signed-off-by: MJ Ponsonby <[email protected]>
---
 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..54acaceb2 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::0200:00ff:fe01:0203"
         networks: [["192.168.1.1/24"]]
 ])
 
diff --git a/utilities/ovn-nbctl.c b/utilities/ovn-nbctl.c
index 32ca4f750..51c3f5afd 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(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
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to