From patchwork Thu Jan 18 14:54:26 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ales Musil X-Patchwork-Id: 1888037 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" (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=Pa6FsbMw; 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 4TG5Pb2GL8z23dx for ; Fri, 19 Jan 2024 01:54:41 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 6C3A183C4C; Thu, 18 Jan 2024 14:54:39 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org 6C3A183C4C Authentication-Results: smtp1.osuosl.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=Pa6FsbMw X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id jZ-zDGEdT2Gw; Thu, 18 Jan 2024 14:54:38 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [IPv6:2605:bc80:3010:104::8cd3:938]) by smtp1.osuosl.org (Postfix) with ESMTPS id 59CA483C2D; Thu, 18 Jan 2024 14:54:37 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org 59CA483C2D Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 2D983C0077; Thu, 18 Jan 2024 14:54:37 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from smtp2.osuosl.org (smtp2.osuosl.org [IPv6:2605:bc80:3010::133]) by lists.linuxfoundation.org (Postfix) with ESMTP id 48625C0037 for ; Thu, 18 Jan 2024 14:54:35 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id 298B0403E2 for ; Thu, 18 Jan 2024 14:54:35 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org 298B0403E2 Authentication-Results: smtp2.osuosl.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=Pa6FsbMw X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id IBNsc4qZ62FF for ; Thu, 18 Jan 2024 14:54:33 +0000 (UTC) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by smtp2.osuosl.org (Postfix) with ESMTPS id ACFE140217 for ; Thu, 18 Jan 2024 14:54:33 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org ACFE140217 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1705589672; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6yPRwqxoBWcWJzBObXNWcqH9TqVIH5+B5E07pHX3trQ=; b=Pa6FsbMwHWUYX9gCvC9vEs0RdbsECx2N+ff8Wl2bUAJAnyXS+k7iTsR6aamoCrGaopmEZS E9wnEpN7T79d1Vbf/H6Ktw3S9lakz++hApsXfI42S4N4mGM4O8zoqPUHTEAK8V1wU4qFpB DGmKJ8dO5mW4CNR6lr5meaILZerLphg= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-594-IWpZ7TU2POuwpOnTuvwEgg-1; Thu, 18 Jan 2024 09:54:31 -0500 X-MC-Unique: IWpZ7TU2POuwpOnTuvwEgg-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (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 mimecast-mx02.redhat.com (Postfix) with ESMTPS id 3611885A596 for ; Thu, 18 Jan 2024 14:54:31 +0000 (UTC) Received: from amusil.redhat.com (unknown [10.45.225.106]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6A945112131D; Thu, 18 Jan 2024 14:54:30 +0000 (UTC) From: Ales Musil To: dev@openvswitch.org Date: Thu, 18 Jan 2024 15:54:26 +0100 Message-ID: <20240118145426.271860-1-amusil@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.3 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Cc: dceara@redhat.com Subject: [ovs-dev] [PATCH ovn] northd: Use proper field for lookup_nd X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ovs-dev-bounces@openvswitch.org Sender: "dev" We are intentionally skipping ND NA with LLA as source. However, this doesn't work when the ND NA has LLA source, but the target address is global one. In that case we would skip update of already existing entry when always_learn_from_arp_request is set to false. Use ND target address in the check instead of source. Fixes: 5e0cb03605ea ("northd: Add logical flow to skip GARP with LLA") Reported-at: https://issues.redhat.com/browse/FDP-283 Signed-off-by: Ales Musil Acked-by: Xavier Simonart --- northd/northd.c | 4 ++-- tests/ovn.at | 25 ++++++++++++++++++++++--- 2 files changed, 24 insertions(+), 5 deletions(-) diff --git a/northd/northd.c b/northd/northd.c index 952f8200d..de15ca101 100644 --- a/northd/northd.c +++ b/northd/northd.c @@ -13171,9 +13171,9 @@ build_neigh_learning_flows_for_lrouter( * address, the all-nodes multicast address. */ ds_clear(actions); ds_put_format(actions, REGBIT_LOOKUP_NEIGHBOR_RESULT - " = lookup_nd(inport, ip6.src, nd.tll); " + " = lookup_nd(inport, nd.target, nd.tll); " REGBIT_LOOKUP_NEIGHBOR_IP_RESULT - " = lookup_nd_ip(inport, ip6.src); next;"); + " = lookup_nd_ip(inport, nd.target); next;"); ovn_lflow_add(lflows, od, S_ROUTER_IN_LOOKUP_NEIGHBOR, 110, "nd_na && ip6.src == fe80::/10 && ip6.dst == ff00::/8", ds_cstr(actions)); diff --git a/tests/ovn.at b/tests/ovn.at index 2dd46fd79..26c516ef9 100644 --- a/tests/ovn.at +++ b/tests/ovn.at @@ -5385,10 +5385,11 @@ test_arp() { } test_na() { - local inport=$1 sha=$2 spa=$3 + local inport=$1 sha=$2 spa=$3 src=${4-$3} local request=$(fmt_pkt "Ether(dst='ff:ff:ff:ff:ff:ff', src='${sha}')/ \ - IPv6(dst='ff01::1', src='${spa}')/ \ - ICMPv6ND_NA(tgt='${spa}')") + IPv6(dst='ff01::1', src='${src}')/ \ + ICMPv6ND_NA(tgt='${spa}')/ \ + ICMPv6NDOptDstLLAddr(lladdr='${sha}')") hv=hv`vif_to_hv $inport` as $hv ovs-appctl netdev-dummy/receive vif$inport $request @@ -5464,6 +5465,24 @@ for i in 1 2; do done done +# Make sure that we can update existing entry with +# "always_learn_from_arp_request=false" even when the source of NA src is LLA. +ovn-sbctl --all destroy mac_binding +ovn-nbctl --wait=hv set logical_router lr0 options:always_learn_from_arp_request=false + +sha="f0:00:00:00:00:11" +spa6="fd00::abcd:1" + +test_na 11 $sha $spa6 +wait_row_count MAC_Binding 1 ip=\"$spa6\" mac=\"$sha\" + +sha="f0:00:00:00:00:12" +lla6="fe80::abcd:1" + +test_na 11 $sha $spa6 $lla6 +wait_row_count MAC_Binding 1 ip=\"$spa6\" mac=\"$sha\" +check_row_count MAC_Binding 0 ip=\"$lla6\" + # Gracefully terminate daemons OVN_CLEANUP([hv1], [hv2])