Skip to content

Commit

Permalink
l2tp: introduce L2TPv3 IP encapsulation support for IPv6
Browse files Browse the repository at this point in the history
L2TPv3 defines an IP encapsulation packet format where data is carried
directly over IP (no UDP). The kernel already has support for L2TP IP
encapsulation over IPv4 (l2tp_ip). This patch introduces support for
L2TP IP encapsulation over IPv6.

The implementation is derived from ipv6/raw and ipv4/l2tp_ip.

Signed-off-by: Chris Elston <celston@katalix.com>
Signed-off-by: James Chapman <jchapman@katalix.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
cdelston authored and davem330 committed May 1, 2012
1 parent a495f83 commit a32e0ee
Show file tree
Hide file tree
Showing 3 changed files with 812 additions and 0 deletions.
17 changes: 17 additions & 0 deletions include/linux/l2tp.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#include <linux/socket.h>
#ifdef __KERNEL__
#include <linux/in.h>
#include <linux/in6.h>
#else
#include <netinet/in.h>
#endif
Expand Down Expand Up @@ -39,6 +40,22 @@ struct sockaddr_l2tpip {
sizeof(__u32)];
};

/**
* struct sockaddr_l2tpip6 - the sockaddr structure for L2TP-over-IPv6 sockets
* @l2tp_family: address family number AF_L2TPIP.
* @l2tp_addr: protocol specific address information
* @l2tp_conn_id: connection id of tunnel
*/
struct sockaddr_l2tpip6 {
/* The first fields must match struct sockaddr_in6 */
__kernel_sa_family_t l2tp_family; /* AF_INET6 */
__be16 l2tp_unused; /* INET port number (unused) */
__be32 l2tp_flowinfo; /* IPv6 flow information */
struct in6_addr l2tp_addr; /* IPv6 address */
__u32 l2tp_scope_id; /* scope id (new in RFC2553) */
__u32 l2tp_conn_id; /* Connection ID of tunnel */
};

/*****************************************************************************
* NETLINK_GENERIC netlink family.
*****************************************************************************/
Expand Down
3 changes: 3 additions & 0 deletions net/l2tp/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,6 @@ obj-$(subst y,$(CONFIG_L2TP),$(CONFIG_L2TP_IP)) += l2tp_ip.o
obj-$(subst y,$(CONFIG_L2TP),$(CONFIG_L2TP_V3)) += l2tp_netlink.o
obj-$(subst y,$(CONFIG_L2TP),$(CONFIG_L2TP_ETH)) += l2tp_eth.o
obj-$(subst y,$(CONFIG_L2TP),$(CONFIG_L2TP_DEBUGFS)) += l2tp_debugfs.o
ifneq ($(CONFIG_IPV6),)
obj-$(subst y,$(CONFIG_L2TP),$(CONFIG_L2TP_IP)) += l2tp_ip6.o
endif
Loading

0 comments on commit a32e0ee

Please sign in to comment.