From patchwork Mon Jun 18 11:56:00 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lorenzo Bianconi X-Patchwork-Id: 930815 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=openvswitch.org (client-ip=140.211.169.12; helo=mail.linuxfoundation.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Received: from mail.linuxfoundation.org (mail.linuxfoundation.org [140.211.169.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 418V2f2yrPz9ry1 for ; Mon, 18 Jun 2018 21:57:30 +1000 (AEST) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id CD887D71; Mon, 18 Jun 2018 11:56:19 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@mail.linuxfoundation.org Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org [172.17.192.35]) by mail.linuxfoundation.org (Postfix) with ESMTPS id 6575ED70 for ; Mon, 18 Jun 2018 11:56:18 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.7.6 Received: from mail-wm0-f41.google.com (mail-wm0-f41.google.com [74.125.82.41]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id AEA1A335 for ; Mon, 18 Jun 2018 11:56:17 +0000 (UTC) Received: by mail-wm0-f41.google.com with SMTP id x6-v6so13557195wmc.3 for ; Mon, 18 Jun 2018 04:56:17 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=4IlTeGbG5fSholGKH0wE8mjhfh04kSmAS6WT1wDvJqA=; b=JyKNGfPytG5sb1zslOrTqgfDJtVJVeBOiP50oTkk9ALduxS5lTL9bexw5hEcG9FlDM V7dbBcJFWK0kUi6HKhsE5W/rpviMv2rtfUaemmPInOkuXsmPFVTKM81tL6AqpMzRZMsB x3rV+VYSkQLQmQp4CdwyoXrFt6ufkL/d52MUBcDcNv3j+scTc3CHtom2MRSgJeYwPZio 2DuIxE/0I8GHK2MVHG4a1/oHDCHPLqnXm0Ry7B5C2Ct5+P/QVGJYWrk6Mlvjyez1bvo5 WLB1W6B1Vsh29XbIJJlSY3WslNzyE5lO4qkzxYYo7K9Jliwdr1dOlUt1QyB4zs8opsYo 4I+w== X-Gm-Message-State: APt69E0VlcZWxusRP/ux4tdTFBGEFgJF41caSo4pDnDnqwMGYz8mmg/N CvYxXtqH4+ubGaj9h8yiF09eqaEB+t4= X-Google-Smtp-Source: ADUXVKJTk40QtxZJQE/+MIX8KdMv+7u4Petey5nROEw+ix+IaVC3+26jFySerAmDnae8bWn7GFP/Hw== X-Received: by 2002:a1c:dcd4:: with SMTP id t203-v6mr7713916wmg.156.1529322976092; Mon, 18 Jun 2018 04:56:16 -0700 (PDT) Received: from localhost.localdomain.com (nat-pool-mxp-t.redhat.com. [149.6.153.186]) by smtp.gmail.com with ESMTPSA id y30-v6sm17981450wrd.70.2018.06.18.04.56.15 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 18 Jun 2018 04:56:15 -0700 (PDT) From: Lorenzo Bianconi To: dev@openvswitch.org Date: Mon, 18 Jun 2018 13:56:00 +0200 Message-Id: X-Mailer: git-send-email 2.17.1 In-Reply-To: References: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on smtp1.linux-foundation.org Subject: [ovs-dev] [PATCH v2 3/3] OVN: add protocol unreachable support to OVN router ports X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: ovs-dev-bounces@openvswitch.org Errors-To: ovs-dev-bounces@openvswitch.org Add priority-70 flows to generate ICMP protocol unreachable messages in reply to packets directed to the router's IP address on IP protocols other than UDP, TCP, and ICMP Signed-off-by: Lorenzo Bianconi --- ovn/northd/ovn-northd.8.xml | 4 ---- ovn/northd/ovn-northd.c | 14 ++++++++++++++ tests/ovn.at | 1 + 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/ovn/northd/ovn-northd.8.xml b/ovn/northd/ovn-northd.8.xml index 18a481b3d..cfd35115e 100644 --- a/ovn/northd/ovn-northd.8.xml +++ b/ovn/northd/ovn-northd.8.xml @@ -1342,10 +1342,6 @@ nd_na {

These flows should not match IP fragments with nonzero offset.

- -

- Details TBD. Not yet implemented. -

  • diff --git a/ovn/northd/ovn-northd.c b/ovn/northd/ovn-northd.c index 27d7aab06..7777b83f5 100644 --- a/ovn/northd/ovn-northd.c +++ b/ovn/northd/ovn-northd.c @@ -5175,6 +5175,20 @@ build_lrouter_flows(struct hmap *datapaths, struct hmap *ports, "next; };"; ovn_lflow_add(lflows, op->od, S_ROUTER_IN_IP_INPUT, 80, ds_cstr(&match), action); + + ds_clear(&match); + ds_put_format(&match, + "ip4 && ip4.dst == %s && !ip.later_frag", + op->lrp_networks.ipv4_addrs[i].addr_s); + action = "icmp4 {" + "eth.dst <-> eth.src; " + "ip4.dst <-> ip4.src; " + "ip.ttl = 255; " + "icmp4.type = 3; " + "icmp4.code = 2; " + "next; };"; + ovn_lflow_add(lflows, op->od, S_ROUTER_IN_IP_INPUT, 70, + ds_cstr(&match), action); } ds_clear(&match); diff --git a/tests/ovn.at b/tests/ovn.at index 4648a303c..6553d17c6 100644 --- a/tests/ovn.at +++ b/tests/ovn.at @@ -10444,6 +10444,7 @@ OVN_POPULATE_ARP ovn-nbctl --wait=hv sync test_ip_packet 1 1 000000000001 00000000ff01 $(ip_to_hex 192 168 1 1) $(ip_to_hex 192 168 1 254) 11 0000 7dae fcfc 0303 +test_ip_packet 1 1 000000000001 00000000ff01 $(ip_to_hex 192 168 1 1) $(ip_to_hex 192 168 1 254) 84 0000 7dae fcfd 0302 OVN_CHECK_PACKETS([hv1/vif1-tx.pcap], [vif1.expected]) test_tcp_syn_packet 2 2 000000000002 00000000ff02 $(ip_to_hex 192 168 2 1) $(ip_to_hex 192 168 2 254) 0000 8b40 3039 0000 7bae 4486