aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorBenjamin LaHaise <bcrl@kvack.org>2012-04-27 04:24:18 -0400
committerDavid S. Miller <davem@davemloft.net>2012-04-28 22:21:51 -0400
commitd2cf3361677e5bb5d01d45052212b7050a9aa8c4 (patch)
treea0239e574876ca385c8578c7cbffb783bf951e51 /include/linux
parentd7f3f62167bc2299d9669888b493b6e6ba561c35 (diff)
net/l2tp: add support for L2TP over IPv6 UDP
Now that encap_rcv() works on IPv6 UDP sockets, wire L2TP up to IPv6. Support has been tested with and without hardware offloading. This version fixes the L2TP over localhost issue with incorrect checksums being reported. Signed-off-by: Benjamin LaHaise <bcrl@kvack.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/if_pppol2tp.h28
-rw-r--r--include/linux/if_pppox.h12
2 files changed, 39 insertions, 1 deletions
diff --git a/include/linux/if_pppol2tp.h b/include/linux/if_pppol2tp.h
index 23cefa1111bf..b4775418d525 100644
--- a/include/linux/if_pppol2tp.h
+++ b/include/linux/if_pppol2tp.h
@@ -19,10 +19,11 @@
19 19
20#ifdef __KERNEL__ 20#ifdef __KERNEL__
21#include <linux/in.h> 21#include <linux/in.h>
22#include <linux/in6.h>
22#endif 23#endif
23 24
24/* Structure used to connect() the socket to a particular tunnel UDP 25/* Structure used to connect() the socket to a particular tunnel UDP
25 * socket. 26 * socket over IPv4.
26 */ 27 */
27struct pppol2tp_addr { 28struct pppol2tp_addr {
28 __kernel_pid_t pid; /* pid that owns the fd. 29 __kernel_pid_t pid; /* pid that owns the fd.
@@ -35,6 +36,20 @@ struct pppol2tp_addr {
35 __u16 d_tunnel, d_session; /* For sending outgoing packets */ 36 __u16 d_tunnel, d_session; /* For sending outgoing packets */
36}; 37};
37 38
39/* Structure used to connect() the socket to a particular tunnel UDP
40 * socket over IPv6.
41 */
42struct pppol2tpin6_addr {
43 __kernel_pid_t pid; /* pid that owns the fd.
44 * 0 => current */
45 int fd; /* FD of UDP socket to use */
46
47 __u16 s_tunnel, s_session; /* For matching incoming packets */
48 __u16 d_tunnel, d_session; /* For sending outgoing packets */
49
50 struct sockaddr_in6 addr; /* IP address and port to send to */
51};
52
38/* The L2TPv3 protocol changes tunnel and session ids from 16 to 32 53/* The L2TPv3 protocol changes tunnel and session ids from 16 to 32
39 * bits. So we need a different sockaddr structure. 54 * bits. So we need a different sockaddr structure.
40 */ 55 */
@@ -49,6 +64,17 @@ struct pppol2tpv3_addr {
49 __u32 d_tunnel, d_session; /* For sending outgoing packets */ 64 __u32 d_tunnel, d_session; /* For sending outgoing packets */
50}; 65};
51 66
67struct pppol2tpv3in6_addr {
68 __kernel_pid_t pid; /* pid that owns the fd.
69 * 0 => current */
70 int fd; /* FD of UDP or IP socket to use */
71
72 __u32 s_tunnel, s_session; /* For matching incoming packets */
73 __u32 d_tunnel, d_session; /* For sending outgoing packets */
74
75 struct sockaddr_in6 addr; /* IP address and port to send to */
76};
77
52/* Socket options: 78/* Socket options:
53 * DEBUG - bitmask of debug message categories 79 * DEBUG - bitmask of debug message categories
54 * SENDSEQ - 0 => don't send packets with sequence numbers 80 * SENDSEQ - 0 => don't send packets with sequence numbers
diff --git a/include/linux/if_pppox.h b/include/linux/if_pppox.h
index b5f927f59f26..6720d57cc1ea 100644
--- a/include/linux/if_pppox.h
+++ b/include/linux/if_pppox.h
@@ -83,6 +83,12 @@ struct sockaddr_pppol2tp {
83 struct pppol2tp_addr pppol2tp; 83 struct pppol2tp_addr pppol2tp;
84} __attribute__((packed)); 84} __attribute__((packed));
85 85
86struct sockaddr_pppol2tpin6 {
87 __kernel_sa_family_t sa_family; /* address family, AF_PPPOX */
88 unsigned int sa_protocol; /* protocol identifier */
89 struct pppol2tpin6_addr pppol2tp;
90} __attribute__((packed));
91
86/* The L2TPv3 protocol changes tunnel and session ids from 16 to 32 92/* The L2TPv3 protocol changes tunnel and session ids from 16 to 32
87 * bits. So we need a different sockaddr structure. 93 * bits. So we need a different sockaddr structure.
88 */ 94 */
@@ -92,6 +98,12 @@ struct sockaddr_pppol2tpv3 {
92 struct pppol2tpv3_addr pppol2tp; 98 struct pppol2tpv3_addr pppol2tp;
93} __attribute__((packed)); 99} __attribute__((packed));
94 100
101struct sockaddr_pppol2tpv3in6 {
102 __kernel_sa_family_t sa_family; /* address family, AF_PPPOX */
103 unsigned int sa_protocol; /* protocol identifier */
104 struct pppol2tpv3in6_addr pppol2tp;
105} __attribute__((packed));
106
95/********************************************************************* 107/*********************************************************************
96 * 108 *
97 * ioctl interface for defining forwarding of connections 109 * ioctl interface for defining forwarding of connections