Skip to content

Commit

Permalink
netfilter: ipset: Explicitly add padding elements to hash:net, net an…
Browse files Browse the repository at this point in the history
…d hash:net, port, net

The elements must be u32 sized for the used hash function.

Signed-off-by: Jozsef Kadlecsik <kadlec@blackhole.kfki.hu>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
  • Loading branch information
Jozsef Kadlecsik authored and Pablo Neira Ayuso committed Dec 3, 2014
1 parent 77b4311 commit cac3763
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions net/netfilter/ipset/ip_set_hash_netnet.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ struct hash_netnet4_elem {
__be64 ipcmp;
};
u8 nomatch;
u8 padding;
union {
u8 cidr[2];
u16 ccmp;
Expand Down Expand Up @@ -271,6 +272,7 @@ hash_netnet4_uadt(struct ip_set *set, struct nlattr *tb[],
struct hash_netnet6_elem {
union nf_inet_addr ip[2];
u8 nomatch;
u8 padding;
union {
u8 cidr[2];
u16 ccmp;
Expand Down
2 changes: 2 additions & 0 deletions net/netfilter/ipset/ip_set_hash_netportnet.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ struct hash_netportnet4_elem {
u8 cidr[2];
u16 ccmp;
};
u16 padding;
u8 nomatch:1;
u8 proto;
};
Expand Down Expand Up @@ -324,6 +325,7 @@ struct hash_netportnet6_elem {
u8 cidr[2];
u16 ccmp;
};
u16 padding;
u8 nomatch:1;
u8 proto;
};
Expand Down

0 comments on commit cac3763

Please sign in to comment.