From patchwork Mon Feb 24 22:42:38 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gregory Rose X-Patchwork-Id: 1243669 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org (client-ip=140.211.166.138; helo=whitealder.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=TmuQHug8; dkim-atps=neutral Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 48RHD36RQGz9sPR for ; Tue, 25 Feb 2020 09:43:47 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 5E4CC86569; Mon, 24 Feb 2020 22:43:46 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id YWlz8FD2LFMb; Mon, 24 Feb 2020 22:43:43 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by whitealder.osuosl.org (Postfix) with ESMTP id BC342869BF; Mon, 24 Feb 2020 22:43:13 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id AF5ABC1D93; Mon, 24 Feb 2020 22:43:13 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by lists.linuxfoundation.org (Postfix) with ESMTP id 76555C1D89 for ; Mon, 24 Feb 2020 22:43:12 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 5FC13866F0 for ; Mon, 24 Feb 2020 22:43:12 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id V3yu3hMIu2pW for ; Mon, 24 Feb 2020 22:43:06 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-pg1-f194.google.com (mail-pg1-f194.google.com [209.85.215.194]) by whitealder.osuosl.org (Postfix) with ESMTPS id E59A686717 for ; Mon, 24 Feb 2020 22:42:58 +0000 (UTC) Received: by mail-pg1-f194.google.com with SMTP id a14so5475144pgb.11 for ; Mon, 24 Feb 2020 14:42:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=3dxl1lYeSh+jSGr+jJqrcrjQCXvXM0CpERWQo+w0EYQ=; b=TmuQHug8la9zOYvazi6AIVH6lcymkrc2hmVUG+XFFQxBZxbG1/TosD7290mQ1FJJVI ZRSHO5cs2XMtJ8oj5xIQAGG2JiG2oQZ005ohqyjSiaMvrAru+JuaaH8VzW0HWKM9sdOB oWmKJVFuJ0MnLuRpYqTDGE7BQ74e3Uda+pXH27yzeqj5imQA3I8yt4ZCRxYcxSACmjq6 BGrihnquHoTGTpdd3wuqmWGGHnDc+j3qp77u6T0g1XjJWy9snfV1wBKx0MX550lcje2H vCPo/jbjwQtP8Af+g/X5l1obsvZLDYR4z8MysqpB5eOM3Uo7796VnDnBUAgnhSzt+UC7 gvog== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=3dxl1lYeSh+jSGr+jJqrcrjQCXvXM0CpERWQo+w0EYQ=; b=gbf+pDjRxjKbPl9SaaFUTpKWlgCZ8FieEfTwO+yZXJ9BAyTd9kvOsoR9iC1I6sQBvk AnRe4c9+u+nZXwsyN05bsLaxvqdYz7FylpnsTb2Y6tY+1sd2ZXTZo8vLwGR1fHEJ3vCV E4QJ7WbKsxYzL8ldzAdpaVUTWUgzgM+utM9Y5nscZqPl6dDDF+P5lE3yrSHUcsgCHhqz Rj1dhZTTg5km57+OLiO5P+ppKY76iPMzwzvquoXVlJMMQal2e31Eg/NLOfW+n6YHQ5f/ 6kIv0SiZ+p7hO5Dx20YcKRfYrEcfopGCU8kmfC22Cb1K4prADs2vnPaBlAa4nZ50lSEz CmGg== X-Gm-Message-State: APjAAAUjsxY4Kyth9/suhLfbTFE2ebRQ0cy+wZcgsSmlspjtbj6xMBoU TYGpVRURj1bYusY1ft8K5kP6sUj/DeY= X-Google-Smtp-Source: APXvYqy2V+xr/hSRg6f/TA0sp5i/D/DBjkf5vm8ewCT9gjfXVwi0vSXEP4EMAPt7XFIJLIaO298YaQ== X-Received: by 2002:a63:da45:: with SMTP id l5mr13195248pgj.273.1582584178160; Mon, 24 Feb 2020 14:42:58 -0800 (PST) Received: from gizo.domain (97-115-113-182.ptld.qwest.net. [97.115.113.182]) by smtp.gmail.com with ESMTPSA id 133sm14320705pfy.14.2020.02.24.14.42.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 24 Feb 2020 14:42:57 -0800 (PST) From: Greg Rose To: dev@openvswitch.org Date: Mon, 24 Feb 2020 14:42:38 -0800 Message-Id: <1582584158-16348-9-git-send-email-gvrose8192@gmail.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1582584158-16348-1-git-send-email-gvrose8192@gmail.com> References: <1582584158-16348-1-git-send-email-gvrose8192@gmail.com> Subject: [ovs-dev] [PATCH 9/9] compat: Use nla_parse deprecated functions 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: , MIME-Version: 1.0 Errors-To: ovs-dev-bounces@openvswitch.org Sender: "dev" Changes for in kernel generated netlink attribute parsing functions require our out of tree driver to use the deprecated forms of those functions. Otherwise the message parsing will return -EINVAL because NLA_F_NESTED is not set in the nla_type field. Signed-off-by: Greg Rose --- acinclude.m4 | 3 +++ datapath/linux/compat/include/net/netlink.h | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/acinclude.m4 b/acinclude.m4 index a55c905..43d1576 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -1072,6 +1072,9 @@ AC_DEFUN([OVS_CHECK_LINUX_COMPAT], [ OVS_FIND_FIELD_IFELSE([$KSRC/include/net/genetlink.h], [genl_ops], [policy], [OVS_DEFINE([HAVE_GENL_OPS_POLICY])]) + OVS_GREP_IFELSE([$KSRC/include/net/netlink.h], + [nla_parse_deprecated_strict], + [OVS_DEFINE([HAVE_NLA_PARSE_DEPRECATED_STRICT])]) if cmp -s datapath/linux/kcompat.h.new \ datapath/linux/kcompat.h >/dev/null 2>&1; then diff --git a/datapath/linux/compat/include/net/netlink.h b/datapath/linux/compat/include/net/netlink.h index 34fc346..7c0d993 100644 --- a/datapath/linux/compat/include/net/netlink.h +++ b/datapath/linux/compat/include/net/netlink.h @@ -143,6 +143,10 @@ static inline int nla_put_be64(struct sk_buff *skb, int attrtype, __be64 value, #endif +#ifdef HAVE_NLA_PARSE_DEPRECATED_STRICT +#define nla_parse_nested nla_parse_nested_deprecated +#define nla_parse nla_parse_deprecated_strict +#else #ifndef HAVE_NETLINK_EXT_ACK struct netlink_ext_ack; @@ -164,6 +168,7 @@ static inline int rpl_nla_parse(struct nlattr **tb, int maxtype, } #define nla_parse rpl_nla_parse #endif +#endif /* HAVE_NLA_PARSE_DEPRECATED_STRICT */ #ifndef HAVE_NLA_NEST_START_NOFLAG static inline struct nlattr *rpl_nla_nest_start_noflag(struct sk_buff *skb,