From patchwork Fri Jul 5 16:40:47 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mj Ponsonby X-Patchwork-Id: 1957407 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=canonical.com header.i=@canonical.com header.a=rsa-sha256 header.s=20210705 header.b=kY6B1HAh; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org (client-ip=2605:bc80:3010::138; helo=smtp1.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=patchwork.ozlabs.org) Received: from smtp1.osuosl.org (smtp1.osuosl.org [IPv6:2605:bc80:3010::138]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4WFzmK4SF5z1xqb for ; Sat, 6 Jul 2024 02:41:05 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id A1326846E4; Fri, 5 Jul 2024 16:41:03 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id iS11dx4nSUIW; Fri, 5 Jul 2024 16:41:02 +0000 (UTC) X-Comment: SPF check N/A for local connections - client-ip=2605:bc80:3010:104::8cd3:938; helo=lists.linuxfoundation.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver= DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org 781F78464D Authentication-Results: smtp1.osuosl.org; dkim=fail reason="signature verification failed" (2048-bit key, unprotected) header.d=canonical.com header.i=@canonical.com header.a=rsa-sha256 header.s=20210705 header.b=kY6B1HAh Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [IPv6:2605:bc80:3010:104::8cd3:938]) by smtp1.osuosl.org (Postfix) with ESMTPS id 781F78464D; Fri, 5 Jul 2024 16:41:02 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 4ABAEC0A97; Fri, 5 Jul 2024 16:41:02 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from smtp4.osuosl.org (smtp4.osuosl.org [IPv6:2605:bc80:3010::137]) by lists.linuxfoundation.org (Postfix) with ESMTP id 5B651C0A96 for ; Fri, 5 Jul 2024 16:41:00 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 4A33A40934 for ; Fri, 5 Jul 2024 16:41:00 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id 7Ar1dtw3l8Nv for ; Fri, 5 Jul 2024 16:40:59 +0000 (UTC) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=185.125.188.120; helo=smtp-relay-canonical-0.canonical.com; envelope-from=mj.ponsonby@canonical.com; receiver= DMARC-Filter: OpenDMARC Filter v1.4.2 smtp4.osuosl.org 025B4407FD Authentication-Results: smtp4.osuosl.org; dmarc=pass (p=none dis=none) header.from=canonical.com DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 025B4407FD Authentication-Results: smtp4.osuosl.org; dkim=pass (2048-bit key, unprotected) header.d=canonical.com header.i=@canonical.com header.a=rsa-sha256 header.s=20210705 header.b=kY6B1HAh Received: from smtp-relay-canonical-0.canonical.com (smtp-relay-canonical-0.canonical.com [185.125.188.120]) by smtp4.osuosl.org (Postfix) with ESMTPS id 025B4407FD for ; Fri, 5 Jul 2024 16:40:58 +0000 (UTC) Received: from Zampano.. (92.40.212.171.threembb.co.uk [92.40.212.171]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-canonical-0.canonical.com (Postfix) with ESMTPSA id B21C74014A; Fri, 5 Jul 2024 16:40:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1720197655; bh=DjjbXzLvF5qbnWzuogoiEF2qdVqs3opyYihH6rG4wtY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=kY6B1HAhAqdtSubPZzM7TUkmu3cV1uUT5+EnPpZNPohxTheBkvDsHEGjhvmKsmCNZ oys08CmuyLxNNCrCtMKBBvRgQ5IXf+8AH4g1Xp94qQqNw/0bRACR3LhqGmXbsTJY7X HDGfPnPvIIPWR00mq5/7zxAWra4u+Na9VEiQxQq/A88AK3uhI0++RmBDAPJKutKok/ zcyFh6CSdVDJb+C1L/Ozq+zMIPzwkljwKPhGnUq7D2LVNtbm7aqAaQCAu8w4bcspVt XAnTh1YcqKk8fQvWqpviNNheHZ8srHy5Mkk2Z79gK1ENuBsCud25CbBSnx+TV1558u PMLAySCMCb5aA== From: Mj Ponsonby To: dev@openvswitch.org Cc: MJ Ponsonby Date: Fri, 5 Jul 2024 17:40:47 +0100 Message-ID: <20240705164047.8326-1-mj.ponsonby@canonical.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240704160743.701001-1-mj.ponsonby@canonical.com> References: <20240704160743.701001-1-mj.ponsonby@canonical.com> MIME-Version: 1.0 Subject: [ovs-dev] [PATCH v2 ovn] nbctl: Added local link ipv6 to nbctl show. X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ovs-dev-bounces@openvswitch.org Sender: "dev" From: MJ Ponsonby 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 --- 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: [");