public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: kailueke@linux.microsoft.com
To: netdev@vger.kernel.org,
	Steffen Klassert <steffen.klassert@secunet.com>,
	Eyal Birger <eyal.birger@gmail.com>
Subject: [PATCH 1/2] Revert "xfrm: interface with if_id 0 should return error"
Date: Tue,  1 Mar 2022 14:15:11 +0100	[thread overview]
Message-ID: <20220301131512.1303-1-kailueke@linux.microsoft.com> (raw)

From: Kai Lueke <kailueke@linux.microsoft.com>

This reverts commit 8dce43919566f06e865f7e8949f5c10d8c2493f5 because it
breaks userspace (e.g., Cilium is affected because it used id 0 for the
dummy state https://github.com/cilium/cilium/pull/18789).

Signed-off-by: Kai Lueke <kailueke@linux.microsoft.com>
---
 net/xfrm/xfrm_interface.c | 14 ++------------
 1 file changed, 2 insertions(+), 12 deletions(-)

diff --git a/net/xfrm/xfrm_interface.c b/net/xfrm/xfrm_interface.c
index 57448fc519fc..41de46b5ffa9 100644
--- a/net/xfrm/xfrm_interface.c
+++ b/net/xfrm/xfrm_interface.c
@@ -637,16 +637,11 @@ static int xfrmi_newlink(struct net *src_net, struct net_device *dev,
 			struct netlink_ext_ack *extack)
 {
 	struct net *net = dev_net(dev);
-	struct xfrm_if_parms p = {};
+	struct xfrm_if_parms p;
 	struct xfrm_if *xi;
 	int err;
 
 	xfrmi_netlink_parms(data, &p);
-	if (!p.if_id) {
-		NL_SET_ERR_MSG(extack, "if_id must be non zero");
-		return -EINVAL;
-	}
-
 	xi = xfrmi_locate(net, &p);
 	if (xi)
 		return -EEXIST;
@@ -671,12 +666,7 @@ static int xfrmi_changelink(struct net_device *dev, struct nlattr *tb[],
 {
 	struct xfrm_if *xi = netdev_priv(dev);
 	struct net *net = xi->net;
-	struct xfrm_if_parms p = {};
-
-	if (!p.if_id) {
-		NL_SET_ERR_MSG(extack, "if_id must be non zero");
-		return -EINVAL;
-	}
+	struct xfrm_if_parms p;
 
 	xfrmi_netlink_parms(data, &p);
 	xi = xfrmi_locate(net, &p);
-- 
2.25.1


             reply	other threads:[~2022-03-01 13:15 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-01 13:15 kailueke [this message]
2022-03-01 13:15 ` [PATCH 2/2] Revert "xfrm: state and policy should fail if XFRMA_IF_ID 0" kailueke
2022-03-01 13:28 ` [PATCH 1/2] Revert "xfrm: interface with if_id 0 should return error" Eyal Birger
2022-03-01 14:17   ` Kai Lüke
2022-03-01 14:34     ` Eyal Birger
2022-03-01 15:09       ` Paul Chaignon
2022-03-01 15:48         ` Kai Lüke
2022-03-01 16:10           ` Steffen Klassert
2022-03-01 16:44             ` Kai Lueke
2022-03-02  9:27               ` Nicolas Dichtel
2022-03-02 16:04             ` Jakub Kicinski
2022-03-02 18:11               ` Kai Lueke
2022-03-03  5:33                 ` Jakub Kicinski
2022-03-03  7:54                   ` Steffen Klassert
  -- strict thread matches above, loose matches on Subject: below --
2022-02-28 18:55 Kai Lüke
2022-02-28 18:51 Kai Lüke
2022-02-28 18:49 Kai Lüke

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220301131512.1303-1-kailueke@linux.microsoft.com \
    --to=kailueke@linux.microsoft.com \
    --cc=eyal.birger@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=steffen.klassert@secunet.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox