diff mbox series

[net-next,4/6] l2tp: add netlink attributes for ac_ppp session creation

Message ID 20200930210707.10717-5-tparkin@katalix.com
State Changes Requested
Delegated to: David Miller
Headers show
Series l2tp: add ac/pppoe driver | expand

Commit Message

Tom Parkin Sept. 30, 2020, 9:07 p.m. UTC
The AC PPPoE driver will require userspace to pass in both the PPPoE
session ID and the PPPoE peer's MAC address.

Add netlink attributes to allow this to be conveyed in the session
create command.

Signed-off-by: Tom Parkin <tparkin@katalix.com>
---
 include/uapi/linux/l2tp.h | 2 ++
 net/l2tp/l2tp_netlink.c   | 2 ++
 2 files changed, 4 insertions(+)
diff mbox series

Patch

diff --git a/include/uapi/linux/l2tp.h b/include/uapi/linux/l2tp.h
index 30c80d5ba4bf..04e23b34669e 100644
--- a/include/uapi/linux/l2tp.h
+++ b/include/uapi/linux/l2tp.h
@@ -127,6 +127,8 @@  enum {
 	L2TP_ATTR_UDP_ZERO_CSUM6_TX,	/* flag */
 	L2TP_ATTR_UDP_ZERO_CSUM6_RX,	/* flag */
 	L2TP_ATTR_PAD,
+	L2TP_ATTR_PPPOE_SESSION_ID,	/* u16 */
+	L2TP_ATTR_PPPOE_PEER_MAC_ADDR,  /* 6 bytes */
 	__L2TP_ATTR_MAX,
 };
 
diff --git a/net/l2tp/l2tp_netlink.c b/net/l2tp/l2tp_netlink.c
index 2abfea82203d..7050e8e5886e 100644
--- a/net/l2tp/l2tp_netlink.c
+++ b/net/l2tp/l2tp_netlink.c
@@ -920,6 +920,8 @@  static const struct nla_policy l2tp_nl_policy[L2TP_ATTR_MAX + 1] = {
 		.type = NLA_BINARY,
 		.len = 8,
 	},
+	[L2TP_ATTR_PPPOE_SESSION_ID]	= { .type = NLA_U16, },
+	[L2TP_ATTR_PPPOE_PEER_MAC_ADDR] = NLA_POLICY_ETH_ADDR,
 };
 
 static const struct genl_ops l2tp_nl_ops[] = {