mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 19:51:31 -04:00
[NETFILTER]: x_tables: set the protocol family in x_tables targets/matches
Set the family field in xt_[matches|targets] registered. Signed-off-by: Pablo Neira Ayuso <[email protected]> Signed-off-by: Patrick McHardy <[email protected]> Signed-off-by: David S. Miller <[email protected]>
This commit is contained in:
parent
4e3882f773
commit
a45049c51c
32 changed files with 235 additions and 163 deletions
|
|
@ -1377,12 +1377,14 @@ icmp6_checkentry(const char *tablename,
|
|||
static struct ip6t_target ip6t_standard_target = {
|
||||
.name = IP6T_STANDARD_TARGET,
|
||||
.targetsize = sizeof(int),
|
||||
.family = AF_INET6,
|
||||
};
|
||||
|
||||
static struct ip6t_target ip6t_error_target = {
|
||||
.name = IP6T_ERROR_TARGET,
|
||||
.target = ip6t_error,
|
||||
.targetsize = IP6T_FUNCTION_MAXNAMELEN,
|
||||
.family = AF_INET6,
|
||||
};
|
||||
|
||||
static struct nf_sockopt_ops ip6t_sockopts = {
|
||||
|
|
@ -1401,6 +1403,7 @@ static struct ip6t_match icmp6_matchstruct = {
|
|||
.matchsize = sizeof(struct ip6t_icmp),
|
||||
.checkentry = icmp6_checkentry,
|
||||
.proto = IPPROTO_ICMPV6,
|
||||
.family = AF_INET6,
|
||||
};
|
||||
|
||||
static int __init init(void)
|
||||
|
|
@ -1410,9 +1413,9 @@ static int __init init(void)
|
|||
xt_proto_init(AF_INET6);
|
||||
|
||||
/* Noone else will be downing sem now, so we won't sleep */
|
||||
xt_register_target(AF_INET6, &ip6t_standard_target);
|
||||
xt_register_target(AF_INET6, &ip6t_error_target);
|
||||
xt_register_match(AF_INET6, &icmp6_matchstruct);
|
||||
xt_register_target(&ip6t_standard_target);
|
||||
xt_register_target(&ip6t_error_target);
|
||||
xt_register_match(&icmp6_matchstruct);
|
||||
|
||||
/* Register setsockopt */
|
||||
ret = nf_register_sockopt(&ip6t_sockopts);
|
||||
|
|
@ -1429,9 +1432,9 @@ static int __init init(void)
|
|||
static void __exit fini(void)
|
||||
{
|
||||
nf_unregister_sockopt(&ip6t_sockopts);
|
||||
xt_unregister_match(AF_INET6, &icmp6_matchstruct);
|
||||
xt_unregister_target(AF_INET6, &ip6t_error_target);
|
||||
xt_unregister_target(AF_INET6, &ip6t_standard_target);
|
||||
xt_unregister_match(&icmp6_matchstruct);
|
||||
xt_unregister_target(&ip6t_error_target);
|
||||
xt_unregister_target(&ip6t_standard_target);
|
||||
xt_proto_fini(AF_INET6);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue