projects
/
powerpc.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge git://git.kernel.org/pub/scm/linux/kernel/git/sfrench/cifs-2.6
[powerpc.git]
/
net
/
netfilter
/
xt_length.c
diff --git
a/net/netfilter/xt_length.c
b/net/netfilter/xt_length.c
index
67fd30d
..
77288c5
100644
(file)
--- a/
net/netfilter/xt_length.c
+++ b/
net/netfilter/xt_length.c
@@
-31,8
+31,8
@@
match(const struct sk_buff *skb,
int *hotdrop)
{
const struct xt_length_info *info = matchinfo;
int *hotdrop)
{
const struct xt_length_info *info = matchinfo;
- u_int16_t pktlen = ntohs(
skb->nh.iph
->tot_len);
-
+ u_int16_t pktlen = ntohs(
ip_hdr(skb)
->tot_len);
+
return (pktlen >= info->min && pktlen <= info->max) ^ info->invert;
}
return (pktlen >= info->min && pktlen <= info->max) ^ info->invert;
}
@@
-47,8
+47,9
@@
match6(const struct sk_buff *skb,
int *hotdrop)
{
const struct xt_length_info *info = matchinfo;
int *hotdrop)
{
const struct xt_length_info *info = matchinfo;
- u_int16_t pktlen = ntohs(skb->nh.ipv6h->payload_len) + sizeof(struct ipv6hdr);
-
+ const u_int16_t pktlen = (ntohs(ipv6_hdr(skb)->payload_len) +
+ sizeof(struct ipv6hdr));
+
return (pktlen >= info->min && pktlen <= info->max) ^ info->invert;
}
return (pktlen >= info->min && pktlen <= info->max) ^ info->invert;
}