History

netfilter: x_tables: reduce xt_action_param by 8 byte

The fragment offset in ipv4/ipv6 is a 16bit field, so use u16 instead of unsigned int. On 64bit: 40 bytes to 32 bytes. By extension this also reduces nft_pktinfo (56 to 48 byte).

Florian Westphal committed 5 years ago

Commit 586d5a81 parent e0241ae2 files · +2 −2Browse files

Unified · Split

2 files
  1. include/linux/netfilter/x_tables.h +1 −1
  2. net/ipv6/netfilter/ip6_tables.c +1 −1
include/linux/netfilter/x_tables.h+1−1
@@ -36,8 +36,8 @@ struct xt_action_param { · 35 unmodified lines
36 const void *matchinfo, *targinfo;36 const void *matchinfo, *targinfo;
37 };37 };
38 const struct nf_hook_state *state;38 const struct nf_hook_state *state;
39 int fragoff;
40 unsigned int thoff;39 unsigned int thoff;
40 u16 fragoff;
41 bool hotdrop;41 bool hotdrop;
42};42};
43 43
net/ipv6/netfilter/ip6_tables.c+1−1
@@ -51,7 +51,7 @@ ip6_packet_match(const struct sk_buff *skb, · 50 unmodified lines
51 const char *outdev,51 const char *outdev,
52 const struct ip6t_ip6 *ip6info,52 const struct ip6t_ip6 *ip6info,
53 unsigned int *protoff,53 unsigned int *protoff,
54 int *fragoff, bool *hotdrop)54 u16 *fragoff, bool *hotdrop)
55{55{
56 unsigned long ret;56 unsigned long ret;
57 const struct ipv6hdr *ipv6 = ipv6_hdr(skb);57 const struct ipv6hdr *ipv6 = ipv6_hdr(skb);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t