Skip to content

Commit

Permalink
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/gi…
Browse files Browse the repository at this point in the history
…t/pablo/nf-next

Pablo Neira Ayuso says:

====================
This batch contains one single patch with the l2tp match
for xtables, from James Chapman.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
David S. Miller committed Jan 10, 2014
2 parents 11b57f9 + 74f77a6 commit ef8570d
Show file tree
Hide file tree
Showing 5 changed files with 393 additions and 0 deletions.
1 change: 1 addition & 0 deletions include/uapi/linux/netfilter/Kbuild
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ header-y += xt_helper.h
header-y += xt_ipcomp.h
header-y += xt_iprange.h
header-y += xt_ipvs.h
header-y += xt_l2tp.h
header-y += xt_length.h
header-y += xt_limit.h
header-y += xt_mac.h
Expand Down
27 changes: 27 additions & 0 deletions include/uapi/linux/netfilter/xt_l2tp.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#ifndef _LINUX_NETFILTER_XT_L2TP_H
#define _LINUX_NETFILTER_XT_L2TP_H

#include <linux/types.h>

enum xt_l2tp_type {
XT_L2TP_TYPE_CONTROL,
XT_L2TP_TYPE_DATA,
};

/* L2TP matching stuff */
struct xt_l2tp_info {
__u32 tid; /* tunnel id */
__u32 sid; /* session id */
__u8 version; /* L2TP protocol version */
__u8 type; /* L2TP packet type */
__u8 flags; /* which fields to match */
};

enum {
XT_L2TP_TID = (1 << 0), /* match L2TP tunnel id */
XT_L2TP_SID = (1 << 1), /* match L2TP session id */
XT_L2TP_VERSION = (1 << 2), /* match L2TP protocol version */
XT_L2TP_TYPE = (1 << 3), /* match L2TP packet type */
};

#endif /* _LINUX_NETFILTER_XT_L2TP_H */
10 changes: 10 additions & 0 deletions net/netfilter/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -1139,6 +1139,16 @@ config NETFILTER_XT_MATCH_IPVS

If unsure, say N.

config NETFILTER_XT_MATCH_L2TP
tristate '"l2tp" match support'
depends on NETFILTER_ADVANCED
default L2TP
---help---
This option adds an "L2TP" match, which allows you to match against
L2TP protocol header fields.

To compile it as a module, choose M here. If unsure, say N.

config NETFILTER_XT_MATCH_LENGTH
tristate '"length" match support'
depends on NETFILTER_ADVANCED
Expand Down
1 change: 1 addition & 0 deletions net/netfilter/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ obj-$(CONFIG_NETFILTER_XT_MATCH_HL) += xt_hl.o
obj-$(CONFIG_NETFILTER_XT_MATCH_IPCOMP) += xt_ipcomp.o
obj-$(CONFIG_NETFILTER_XT_MATCH_IPRANGE) += xt_iprange.o
obj-$(CONFIG_NETFILTER_XT_MATCH_IPVS) += xt_ipvs.o
obj-$(CONFIG_NETFILTER_XT_MATCH_L2TP) += xt_l2tp.o
obj-$(CONFIG_NETFILTER_XT_MATCH_LENGTH) += xt_length.o
obj-$(CONFIG_NETFILTER_XT_MATCH_LIMIT) += xt_limit.o
obj-$(CONFIG_NETFILTER_XT_MATCH_MAC) += xt_mac.o
Expand Down
Loading

0 comments on commit ef8570d

Please sign in to comment.