From patchwork Tue Nov 3 23:48:50 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Justin Pettit X-Patchwork-Id: 539644 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from archives.nicira.com (unknown [IPv6:2600:3c00::f03c:91ff:fe6e:bdf7]) by ozlabs.org (Postfix) with ESMTP id 9126214131F for ; Wed, 4 Nov 2015 10:49:37 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=nicira_com.20150623.gappssmtp.com header.i=@nicira_com.20150623.gappssmtp.com header.b=rFN0Nv0w; dkim-atps=neutral Received: from archives.nicira.com (localhost [127.0.0.1]) by archives.nicira.com (Postfix) with ESMTP id 7CDF410607; Tue, 3 Nov 2015 15:49:02 -0800 (PST) X-Original-To: dev@openvswitch.org Delivered-To: dev@openvswitch.org Received: from mx1e3.cudamail.com (mx1.cudamail.com [69.90.118.67]) by archives.nicira.com (Postfix) with ESMTPS id B448F10629 for ; Tue, 3 Nov 2015 15:49:01 -0800 (PST) Received: from bar2.cudamail.com (localhost [127.0.0.1]) by mx1e3.cudamail.com (Postfix) with ESMTPS id 1DDA64200C0 for ; Tue, 3 Nov 2015 16:49:01 -0700 (MST) X-ASG-Debug-ID: 1446594540-03dc535bd3d0cb0001-byXFYA Received: from mx1-pf1.cudamail.com ([192.168.24.1]) by bar2.cudamail.com with ESMTP id C0cK0ygWE1aqV9gh (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Tue, 03 Nov 2015 16:49:00 -0700 (MST) X-Barracuda-Envelope-From: jpettit@nicira.com X-Barracuda-RBL-Trusted-Forwarder: 192.168.24.1 Received: from unknown (HELO mail-pa0-f48.google.com) (209.85.220.48) by mx1-pf1.cudamail.com with ESMTPS (RC4-SHA encrypted); 3 Nov 2015 23:49:00 -0000 Received-SPF: unknown (mx1-pf1.cudamail.com: Multiple SPF records returned) X-Barracuda-RBL-Trusted-Forwarder: 209.85.220.48 Received: by pacdm15 with SMTP id dm15so8210334pac.3 for ; Tue, 03 Nov 2015 15:48:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nicira_com.20150623.gappssmtp.com; s=20150623; h=from:to:subject:date:message-id:in-reply-to:references; bh=zd3CCCTeXGMlzaVNmsAwTKEheYw0+sd8LCcYeS8IWzM=; b=rFN0Nv0w7JBlSi6XUY3Q/8xpg5GTDTEeGSnrnjjyLTs1nn7hN7cSUmRTLLDlel1vxt qf2LR2WA5xCgu3KgtuW3crQrnNhDxMD80oH/T1zPUNY87sKOW/bFlOgZQy/E73vxGMMx FpS07pQA/9UqkI5U8o/GITAas3D8EI3r4POO4T9VwUHQc2EEbCLOs1f3P8X5treVJDcg uKo13eYqUXVx4okIUBOLrSBOmHRyB2rDZhppW/XT/dZsBxsXyZdd3HeMkHKg+lBYtBln dRBxOVODDHUqRNJzj9Z2iiFqS19SuU+9H6BXUOXs1/WeKzW76ZoAZPY+Q8xN97B4F5KF bDxQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=zd3CCCTeXGMlzaVNmsAwTKEheYw0+sd8LCcYeS8IWzM=; b=J1hdNMlpT3e9m/sqASiqelngdnfR0PtSzdgdFwC29lWrzP0vukaspB1ktwGce6VmHp nr9byp9f0nTHaslaFkWCKHsT4iWHke1TXzrj3gY6S4JAKz3Cd0fMESF7grdpRdEaSrBR C/9GyTRXqt/ayKvG6dH27BaY0x+zZhWnulRFS+2GPWJ0piDEH2ahJKOR+5aLSctFNLYl kp1CyJgkQas731KWS/1eR6hKrJ4Gz0bKY9Pc00dk9tQyVID9D9iOxbX+Co0B+Sha+zi1 nHbtbkSh0AqPaS5T6/XugjgaMdpdPcyjb7SI+Npks+yBNybrHZ99gZvVk++XujcOgAz+ Bxbg== X-Gm-Message-State: ALoCoQmNAgZzW2K1gXrJmdQTDKxtLUJLlVNjRWBcdGSjkWF3rjsWXmyTibUAmKtCwBessYwpUWyp X-Received: by 10.69.8.34 with SMTP id dh2mr36881102pbd.122.1446594539842; Tue, 03 Nov 2015 15:48:59 -0800 (PST) Received: from localhost.localdomain (c-67-161-8-206.hsd1.ca.comcast.net. [67.161.8.206]) by smtp.gmail.com with ESMTPSA id qf2sm28725441pbb.3.2015.11.03.15.48.59 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 03 Nov 2015 15:48:59 -0800 (PST) X-CudaMail-Envelope-Sender: jpettit@nicira.com X-Barracuda-Apparent-Source-IP: 67.161.8.206 From: Justin Pettit To: dev@openvswitch.org X-CudaMail-Whitelist-To: dev@openvswitch.org X-CudaMail-MID: CM-E1-1102101202 X-CudaMail-DTE: 110315 X-CudaMail-Originating-IP: 209.85.220.48 Date: Tue, 3 Nov 2015 15:48:50 -0800 X-ASG-Orig-Subj: [##CM-E1-1102101202##][ICMP v2 7/7] ovn-northd: Support pinging logical router ports. Message-Id: <1446594530-22162-8-git-send-email-jpettit@nicira.com> X-Mailer: git-send-email 1.7.5.4 In-Reply-To: <1446594530-22162-1-git-send-email-jpettit@nicira.com> References: <1446594530-22162-1-git-send-email-jpettit@nicira.com> X-Barracuda-Connect: UNKNOWN[192.168.24.1] X-Barracuda-Start-Time: 1446594540 X-Barracuda-Encrypted: DHE-RSA-AES256-SHA X-Barracuda-URL: https://web.cudamail.com:443/cgi-mod/mark.cgi X-ASG-Whitelist: Header =?UTF-8?B?eFwtY3VkYW1haWxcLXdoaXRlbGlzdFwtdG8=?= X-Virus-Scanned: by bsmtpd at cudamail.com X-Barracuda-BRTS-Status: 1 Subject: [ovs-dev] [ICMP v2 7/7] ovn-northd: Support pinging logical router ports. X-BeenThere: dev@openvswitch.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dev-bounces@openvswitch.org Sender: "dev" Signed-off-by: Justin Pettit Acked-by: Russell Bryant --- ovn/northd/ovn-northd.8.xml | 5 +---- ovn/northd/ovn-northd.c | 23 ++++++++++++++++++++--- 2 files changed, 21 insertions(+), 7 deletions(-) diff --git a/ovn/northd/ovn-northd.8.xml b/ovn/northd/ovn-northd.8.xml index 6f0a420..e7dec72 100644 --- a/ovn/northd/ovn-northd.8.xml +++ b/ovn/northd/ovn-northd.8.xml @@ -340,6 +340,7 @@ ip4.dst = ip4.src; ip4.src = S; ip.ttl = 255; icmp4.type = 0; +inport = \"\"; /* Allow sending out inport. */ next; @@ -348,10 +349,6 @@ next; each individual inport, and use the same actions in which S is a function of inport.

- -

- Not yet implemented. -

  • diff --git a/ovn/northd/ovn-northd.c b/ovn/northd/ovn-northd.c index 9996584..8fe0c2c 100644 --- a/ovn/northd/ovn-northd.c +++ b/ovn/northd/ovn-northd.c @@ -1295,8 +1295,6 @@ build_lrouter_flows(struct hmap *datapaths, struct hmap *ports, /* This flow table structure is documented in ovn-northd(8), so please * update ovn-northd.8.xml if you change anything. */ - /* XXX ICMP echo reply */ - /* Logical router ingress table 0: Admission control framework. */ struct ovn_datapath *od; HMAP_FOR_EACH (od, key_node, datapaths) { @@ -1384,12 +1382,31 @@ build_lrouter_flows(struct hmap *datapaths, struct hmap *ports, match, "drop;"); free(match); + /* ICMP echo reply. These flows reply to ICMP echo requests + * received for the router's IP address. */ + match = xasprintf( + "inport == %s && (ip4.dst == "IP_FMT" || ip4.dst == "IP_FMT") && " + "icmp4.type == 8 && icmp4.code == 0", + op->json_key, IP_ARGS(op->ip), IP_ARGS(op->bcast)); + char *actions = xasprintf( + "ip4.dst = ip4.src; " + "ip4.src = "IP_FMT"; " + "ip.ttl = 255; " + "icmp4.type = 0; " + "inport = \"\"; /* Allow sending out inport. */ " + "next; ", + IP_ARGS(op->ip)); + ovn_lflow_add(lflows, op->od, S_ROUTER_IN_IP_INPUT, 90, + match, actions); + free(match); + free(actions); + /* ARP reply. These flows reply to ARP requests for the router's own * IP address. */ match = xasprintf( "inport == %s && arp.tpa == "IP_FMT" && arp.op == 1", op->json_key, IP_ARGS(op->ip)); - char *actions = xasprintf( + actions = xasprintf( "eth.dst = eth.src; " "eth.src = "ETH_ADDR_FMT"; " "arp.op = 2; /* ARP reply */ "