Skip to content

Commit

Permalink
Add support for TTL
Browse files Browse the repository at this point in the history
Signed-off-by: rezaadi0105 <[email protected]>
  • Loading branch information
Razziell authored and Joker-V2 committed Jul 24, 2021
1 parent e486a83 commit 4677827
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 0 deletions.
16 changes: 16 additions & 0 deletions include/linux/netfilter_ipv4/ipt_TTL.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/* TTL modification module for IP tables
* (C) 2000 by Harald Welte <[email protected]> */
#ifndef _IPT_TTL_H
#define _IPT_TTL_H
#include <linux/types.h>
enum {
IPT_TTL_SET = 0,
IPT_TTL_INC,
IPT_TTL_DEC
};
#define IPT_TTL_MAXMODE IPT_TTL_DEC
struct ipt_TTL_info {
__u8 mode;
__u8 ttl;
};
#endif
19 changes: 19 additions & 0 deletions include/linux/netfilter_ipv6/ip6t_HL.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/* TTL modification module for IP tables
* (C) 2000 by Harald Welte <[email protected]> */
#ifndef _IP6T_HL_H
#define _IP6T_HL_H
#include <linux/types.h>

enum {
IP6T_HL_SET = 0,
IP6T_HL_INC,
IP6T_HL_DEC
};

#define IP6T_HL_MAXMODE IP6T_HL_DEC

struct ip6t_HL_info {
__u8 mode;
__u8 hop_limit;
};
#endif
3 changes: 3 additions & 0 deletions net/netfilter/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,9 @@ obj-$(CONFIG_NFT_FWD_NETDEV) += nft_fwd_netdev.o
# generic X tables
obj-$(CONFIG_NETFILTER_XTABLES) += x_tables.o xt_tcpudp.o

# TTL
obj-$(CONFIG_IP_NF_TARGET_TTL) += xt_HL.o

# combos
obj-$(CONFIG_NETFILTER_XT_MARK) += xt_mark.o
obj-$(CONFIG_NETFILTER_XT_CONNMARK) += xt_connmark.o
Expand Down

0 comments on commit 4677827

Please sign in to comment.