From patchwork Tue Jul 10 13:34:38 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aaron Conole X-Patchwork-Id: 941996 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 41Q38g4z5lz9s00 for ; Tue, 10 Jul 2018 23:34:43 +1000 (AEST) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id 01D96D94; Tue, 10 Jul 2018 13:34:42 +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 A1AA0CDA for ; Tue, 10 Jul 2018 13:34:40 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mx1.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id 41CD45D3 for ; Tue, 10 Jul 2018 13:34:40 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 4652C7C6A9; Tue, 10 Jul 2018 13:34:39 +0000 (UTC) Received: from dhcp-25.97.bos.redhat.com (unknown [10.18.25.61]) by smtp.corp.redhat.com (Postfix) with ESMTP id 220C0111AF21; Tue, 10 Jul 2018 13:34:39 +0000 (UTC) From: Aaron Conole To: dev@openvswitch.org Date: Tue, 10 Jul 2018 09:34:38 -0400 Message-Id: <20180710133438.24880-1-aconole@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.2]); Tue, 10 Jul 2018 13:34:39 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.2]); Tue, 10 Jul 2018 13:34:39 +0000 (UTC) for IP:'10.11.54.3' DOMAIN:'int-mx03.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'aconole@redhat.com' RCPT:'' X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED 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] xlate: use const struct in6_addr in linklocal check 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 Commit 83c2757bd16e ("xlate: Move tnl_neigh_snoop() to terminate_native_tunnel()") introduced a call to IN6_IS_ADDR_MC_LINKLOCAL() when checking neighbor discovery. The call to this assumes that the argument may be a const uint8_t *. According to The Open Group Base Specifications Issue 7, 2018: macro is of type int and takes a single argument of type const struct in6_addr * The GNU implementation allows a bit of flexibility, by internally casting the argument. However, other implementations (such as OS X) more rigidly implement the standard and fail with errors like: error: member reference base type 'const uint8_t' (aka 'const unsigned char') is not a structure or union Fixes: 83c2757bd16e ("xlate: Move tnl_neigh_snoop() to terminate_native_tunnel()") Cc: Zoltan Balogh Cc: Jan Scheurich Signed-off-by: Aaron Conole --- ofproto/ofproto-dpif-xlate.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ofproto/ofproto-dpif-xlate.c b/ofproto/ofproto-dpif-xlate.c index c02a0327a..8c95935fa 100644 --- a/ofproto/ofproto-dpif-xlate.c +++ b/ofproto/ofproto-dpif-xlate.c @@ -3832,7 +3832,7 @@ is_nd_dst_correct(const struct flow *flow, const struct in6_addr *ipv6_addr) const uint8_t *flow_ipv6_addr = (uint8_t *) &flow->ipv6_dst; const uint8_t *addr = (uint8_t *) ipv6_addr; - return (IN6_IS_ADDR_MC_LINKLOCAL(flow_ipv6_addr) && + return (IN6_IS_ADDR_MC_LINKLOCAL(ipv6_addr) && flow_ipv6_addr[11] == 0x01 && flow_ipv6_addr[12] == 0xff && flow_ipv6_addr[13] == addr[13] &&