public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: "Kai Lüke" <kailueke@linux.microsoft.com>
To: netdev@vger.kernel.org,
	Steffen Klassert <steffen.klassert@secunet.com>,
	Eyal Birger <eyal.birger@gmail.com>
Cc: Kai Lueke <kailuke@microsoft.com>
Subject: [PATCH 1/2] Revert "xfrm: interface with if_id 0 should return error"
Date: Mon, 28 Feb 2022 19:49:01 +0100	[thread overview]
Message-ID: <8c3bb411-26b4-d604-9c21-a1df510a8e93@linux.microsoft.com> (raw)

This reverts commit 68ac0f3810e76a853b5f7b90601a05c3048b8b54 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_user.c | 21 +++------------------
 1 file changed, 3 insertions(+), 18 deletions(-)

diff --git a/net/xfrm/xfrm_user.c b/net/xfrm/xfrm_user.c
index 8cd6c8129004..be89a8ac54a4 100644
--- a/net/xfrm/xfrm_user.c
+++ b/net/xfrm/xfrm_user.c
@@ -630,13 +630,8 @@ static struct xfrm_state
*xfrm_state_construct(struct net *net,
 
     xfrm_smark_init(attrs, &x->props.smark);
 
-    if (attrs[XFRMA_IF_ID]) {
+    if (attrs[XFRMA_IF_ID])
         x->if_id = nla_get_u32(attrs[XFRMA_IF_ID]);
-        if (!x->if_id) {
-            err = -EINVAL;
-            goto error;
-        }
-    }
 
     err = __xfrm_init_state(x, false, attrs[XFRMA_OFFLOAD_DEV]);
     if (err)
@@ -1432,13 +1427,8 @@ static int xfrm_alloc_userspi(struct sk_buff
*skb, struct nlmsghdr *nlh,
 
     mark = xfrm_mark_get(attrs, &m);
 
-    if (attrs[XFRMA_IF_ID]) {
+    if (attrs[XFRMA_IF_ID])
         if_id = nla_get_u32(attrs[XFRMA_IF_ID]);
-        if (!if_id) {
-            err = -EINVAL;
-            goto out_noput;
-        }
-    }
 
     if (p->info.seq) {
         x = xfrm_find_acq_byseq(net, mark, p->info.seq);
@@ -1751,13 +1741,8 @@ static struct xfrm_policy
*xfrm_policy_construct(struct net *net, struct xfrm_us
 
     xfrm_mark_get(attrs, &xp->mark);
 
-    if (attrs[XFRMA_IF_ID]) {
+    if (attrs[XFRMA_IF_ID])
         xp->if_id = nla_get_u32(attrs[XFRMA_IF_ID]);
-        if (!xp->if_id) {
-            err = -EINVAL;
-            goto error;
-        }
-    }
 
     return xp;
  error:
-- 
2.35.1


             reply	other threads:[~2022-02-28 18:49 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-28 18:49 Kai Lüke [this message]
  -- strict thread matches above, loose matches on Subject: below --
2022-02-28 18:51 [PATCH 1/2] Revert "xfrm: interface with if_id 0 should return error" Kai Lüke
2022-02-28 18:55 Kai Lüke
2022-03-01 13:15 kailueke
2022-03-01 13:28 ` 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

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=8c3bb411-26b4-d604-9c21-a1df510a8e93@linux.microsoft.com \
    --to=kailueke@linux.microsoft.com \
    --cc=eyal.birger@gmail.com \
    --cc=kailuke@microsoft.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