All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tom Parkin <tparkin@katalix.com>
To: netdev@vger.kernel.org
Cc: jchapman@katalix.com, Tom Parkin <tparkin@katalix.com>
Subject: [PATCH net-next 3/6] l2tp: allow v2 netlink session create to pass ifname attribute
Date: Wed, 30 Sep 2020 22:07:04 +0100	[thread overview]
Message-ID: <20200930210707.10717-4-tparkin@katalix.com> (raw)
In-Reply-To: <20200930210707.10717-1-tparkin@katalix.com>

Previously L2TP_ATTR_IFNAME was only applicable to an L2TPv3 session,
since it was only used by l2tp_eth.

In order to implement an AC_PPP pseudowire in an L2TPv2 tunnel, it will
be necessary to allow userspace to send an interface name in the session
create message.

Allow the attribute to be handled by l2tp_netlink for L2TPv2 sessions.

Signed-off-by: Tom Parkin <tparkin@katalix.com>
---
 net/l2tp/l2tp_netlink.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/net/l2tp/l2tp_netlink.c b/net/l2tp/l2tp_netlink.c
index 8ef1a579a2b1..2abfea82203d 100644
--- a/net/l2tp/l2tp_netlink.c
+++ b/net/l2tp/l2tp_netlink.c
@@ -604,10 +604,11 @@ static int l2tp_nl_cmd_session_create(struct sk_buff *skb, struct genl_info *inf
 			cfg.peer_cookie_len = len;
 			memcpy(&cfg.peer_cookie[0], nla_data(info->attrs[L2TP_ATTR_PEER_COOKIE]), len);
 		}
-		if (info->attrs[L2TP_ATTR_IFNAME])
-			cfg.ifname = nla_data(info->attrs[L2TP_ATTR_IFNAME]);
 	}
 
+	if (info->attrs[L2TP_ATTR_IFNAME])
+		cfg.ifname = nla_data(info->attrs[L2TP_ATTR_IFNAME]);
+
 	if (info->attrs[L2TP_ATTR_RECV_SEQ])
 		cfg.recv_seq = nla_get_u8(info->attrs[L2TP_ATTR_RECV_SEQ]);
 
-- 
2.17.1


  parent reply	other threads:[~2020-09-30 21:07 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-30 21:07 [PATCH net-next 0/6] l2tp: add ac/pppoe driver Tom Parkin
2020-09-30 21:07 ` [PATCH net-next 1/6] l2tp: add netlink info to session create callback Tom Parkin
2020-09-30 21:07 ` [PATCH net-next 2/6] l2tp: tweak netlink session create to allow L2TPv2 ac_pppoe Tom Parkin
2020-09-30 21:07 ` Tom Parkin [this message]
2020-09-30 21:07 ` [PATCH net-next 4/6] l2tp: add netlink attributes for ac_ppp session creation Tom Parkin
2020-09-30 21:07 ` [PATCH net-next 5/6] l2tp: add ac_pppoe pseudowire driver Tom Parkin
2020-10-01 14:56   ` Jakub Kicinski
2020-10-01 16:24     ` Tom Parkin
2020-09-30 21:07 ` [PATCH net-next 6/6] docs: networking: update l2tp.rst to document PPP_AC pseudowires Tom Parkin
2020-10-01  8:59 ` [PATCH net-next 0/6] l2tp: add ac/pppoe driver James Chapman
2020-10-01 12:26 ` Guillaume Nault
2020-10-01 14:57   ` Tom Parkin
2020-10-01 18:30     ` Guillaume Nault

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=20200930210707.10717-4-tparkin@katalix.com \
    --to=tparkin@katalix.com \
    --cc=jchapman@katalix.com \
    --cc=netdev@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.