diff options
author | Shan Wei <shanwei@cn.fujitsu.com> | 2010-06-09 14:47:40 +0200 |
---|---|---|
committer | Patrick McHardy <kaber@trash.net> | 2010-06-09 14:47:40 +0200 |
commit | 2bf074825403e0e0d623bac7573580773b78abef (patch) | |
tree | eb4904cbc35df4db627a79df0f5c7c29ebfd556a /net/netfilter/xt_sctp.c | |
parent | b3c5163fe0193a74016dba1bb22491e0d1e9aaa4 (diff) | |
download | op-kernel-dev-2bf074825403e0e0d623bac7573580773b78abef.zip op-kernel-dev-2bf074825403e0e0d623bac7573580773b78abef.tar.gz |
netfilter: xt_sctp: use WORD_ROUND macro to calculate length of multiple of 4 bytes
Use WORD_ROUND to round an int up to the next multiple of 4.
Signed-off-by: Shan Wei <shanwei@cn.fujitsu.com>
Signed-off-by: Patrick McHardy <kaber@trash.net>
Diffstat (limited to 'net/netfilter/xt_sctp.c')
-rw-r--r-- | net/netfilter/xt_sctp.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/net/netfilter/xt_sctp.c b/net/netfilter/xt_sctp.c index c04fcf3..ef36a56 100644 --- a/net/netfilter/xt_sctp.c +++ b/net/netfilter/xt_sctp.c @@ -3,6 +3,7 @@ #include <linux/skbuff.h> #include <net/ip.h> #include <net/ipv6.h> +#include <net/sctp/sctp.h> #include <linux/sctp.h> #include <linux/netfilter/x_tables.h> @@ -67,7 +68,7 @@ match_packet(const struct sk_buff *skb, ++i, offset, sch->type, htons(sch->length), sch->flags); #endif - offset += (ntohs(sch->length) + 3) & ~3; + offset += WORD_ROUND(ntohs(sch->length)); pr_debug("skb->len: %d\toffset: %d\n", skb->len, offset); |