mirror of
git://git.code.sf.net/p/xtables-addons/xtables-addons
synced 2025-09-08 05:34:58 +02:00
compat_xtables: move to 2.6.35 xt_action_param (3/3)
Since the last merge of the "api35" branch, further changes were included into nf-next. This set of three commits updates the xtables-addons API to match that.
This commit is contained in:
@@ -34,7 +34,7 @@ static bool xtnu_match_run(const struct sk_buff *skb,
|
|||||||
#if LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 27)
|
#if LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 27)
|
||||||
{
|
{
|
||||||
struct xtnu_match *nm = xtcompat_numatch(cm);
|
struct xtnu_match *nm = xtcompat_numatch(cm);
|
||||||
bool lo_drop = false, lo_ret;
|
bool lo_ret;
|
||||||
struct xt_action_param local_par;
|
struct xt_action_param local_par;
|
||||||
local_par.in = in;
|
local_par.in = in;
|
||||||
local_par.out = out;
|
local_par.out = out;
|
||||||
@@ -42,13 +42,13 @@ static bool xtnu_match_run(const struct sk_buff *skb,
|
|||||||
local_par.matchinfo = matchinfo;
|
local_par.matchinfo = matchinfo;
|
||||||
local_par.fragoff = offset;
|
local_par.fragoff = offset;
|
||||||
local_par.thoff = protoff;
|
local_par.thoff = protoff;
|
||||||
local_par.hotdrop = &lo_drop;
|
local_par.hotdrop = false;
|
||||||
local_par.family = NFPROTO_UNSPEC; /* don't have that info */
|
local_par.family = NFPROTO_UNSPEC; /* don't have that info */
|
||||||
|
|
||||||
if (nm == NULL || nm->match == NULL)
|
if (nm == NULL || nm->match == NULL)
|
||||||
return false;
|
return false;
|
||||||
lo_ret = nm->match(skb, &local_par);
|
lo_ret = nm->match(skb, &local_par);
|
||||||
*hotdrop = lo_drop;
|
*hotdrop = local_par.hotdrop;
|
||||||
return lo_ret;
|
return lo_ret;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@@ -59,6 +59,7 @@ static bool xtnu_match_run(const struct sk_buff *skb,
|
|||||||
{
|
{
|
||||||
struct xtnu_match *nm = xtcompat_numatch(par->match);
|
struct xtnu_match *nm = xtcompat_numatch(par->match);
|
||||||
struct xt_action_param local_par;
|
struct xt_action_param local_par;
|
||||||
|
bool ret;
|
||||||
|
|
||||||
local_par.in = par->in;
|
local_par.in = par->in;
|
||||||
local_par.out = par->out;
|
local_par.out = par->out;
|
||||||
@@ -66,12 +67,14 @@ static bool xtnu_match_run(const struct sk_buff *skb,
|
|||||||
local_par.matchinfo = par->matchinfo;
|
local_par.matchinfo = par->matchinfo;
|
||||||
local_par.fragoff = par->fragoff;
|
local_par.fragoff = par->fragoff;
|
||||||
local_par.thoff = par->thoff;
|
local_par.thoff = par->thoff;
|
||||||
local_par.hotdrop = par->hotdrop;
|
local_par.hotdrop = false;
|
||||||
local_par.family = par->family;
|
local_par.family = par->family;
|
||||||
|
|
||||||
if (nm == NULL || nm->match == NULL)
|
if (nm == NULL || nm->match == NULL)
|
||||||
return false;
|
return false;
|
||||||
return nm->match(skb, &local_par);
|
ret = nm->match(skb, &local_par);
|
||||||
|
*par->hotdrop = local_par.hotdrop;
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@@ -84,7 +84,7 @@ struct xt_action_param {
|
|||||||
int fragoff;
|
int fragoff;
|
||||||
unsigned int thoff, hooknum;
|
unsigned int thoff, hooknum;
|
||||||
u_int8_t family;
|
u_int8_t family;
|
||||||
bool *hotdrop;
|
bool hotdrop;
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@@ -975,7 +975,7 @@ static bool pknock_mt(const struct sk_buff *skb,
|
|||||||
/* We've been asked to examine this packet, and we
|
/* We've been asked to examine this packet, and we
|
||||||
* can't. Hence, no choice but to drop.
|
* can't. Hence, no choice but to drop.
|
||||||
*/
|
*/
|
||||||
*par->hotdrop = true;
|
par->hotdrop = true;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -209,7 +209,7 @@ length2_mt6(const struct sk_buff *skb, struct xt_action_param *par)
|
|||||||
if (info->flags & XT_LENGTH_LAYER3) {
|
if (info->flags & XT_LENGTH_LAYER3) {
|
||||||
len = sizeof(struct ipv6hdr) + ntohs(iph->payload_len);
|
len = sizeof(struct ipv6hdr) + ntohs(iph->payload_len);
|
||||||
} else {
|
} else {
|
||||||
l4proto = llayer4_proto(skb, &thoff, par->hotdrop);
|
l4proto = llayer4_proto(skb, &thoff, &par->hotdrop);
|
||||||
if (l4proto == NEXTHDR_MAX)
|
if (l4proto == NEXTHDR_MAX)
|
||||||
return false;
|
return false;
|
||||||
if (info->flags & XT_LENGTH_LAYER4)
|
if (info->flags & XT_LENGTH_LAYER4)
|
||||||
|
Reference in New Issue
Block a user