#define pr_fmt(fmt) …
#include <linux/module.h>
#include <linux/skbuff.h>
#include <linux/ip.h>
#include <linux/gfp.h>
#include <linux/ipv6.h>
#include <linux/tcp.h>
#include <net/dst.h>
#include <net/flow.h>
#include <net/ipv6.h>
#include <net/route.h>
#include <net/tcp.h>
#include <linux/netfilter_ipv4/ip_tables.h>
#include <linux/netfilter_ipv6/ip6_tables.h>
#include <linux/netfilter/x_tables.h>
#include <linux/netfilter/xt_tcpudp.h>
#include <linux/netfilter/xt_TCPMSS.h>
MODULE_LICENSE(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_ALIAS(…) …;
MODULE_ALIAS(…) …;
static inline unsigned int
optlen(const u_int8_t *opt, unsigned int offset)
{ … }
static u_int32_t tcpmss_reverse_mtu(struct net *net,
const struct sk_buff *skb,
unsigned int family)
{ … }
static int
tcpmss_mangle_packet(struct sk_buff *skb,
const struct xt_action_param *par,
unsigned int family,
unsigned int tcphoff,
unsigned int minlen)
{ … }
static unsigned int
tcpmss_tg4(struct sk_buff *skb, const struct xt_action_param *par)
{ … }
#if IS_ENABLED(CONFIG_IP6_NF_IPTABLES)
static unsigned int
tcpmss_tg6(struct sk_buff *skb, const struct xt_action_param *par)
{ … }
#endif
static inline bool find_syn_match(const struct xt_entry_match *m)
{ … }
static int tcpmss_tg4_check(const struct xt_tgchk_param *par)
{ … }
#if IS_ENABLED(CONFIG_IP6_NF_IPTABLES)
static int tcpmss_tg6_check(const struct xt_tgchk_param *par)
{ … }
#endif
static struct xt_target tcpmss_tg_reg[] __read_mostly = …;
static int __init tcpmss_tg_init(void)
{ … }
static void __exit tcpmss_tg_exit(void)
{ … }
module_init(…) …;
module_exit(tcpmss_tg_exit);