summaryrefslogtreecommitdiff
path: root/net/netfilter
diff options
context:
space:
mode:
authorShan Wei <shanwei@cn.fujitsu.com>2010-06-09 16:47:40 +0400
committerPatrick McHardy <kaber@trash.net>2010-06-09 16:47:40 +0400
commit2bf074825403e0e0d623bac7573580773b78abef (patch)
treeeb4904cbc35df4db627a79df0f5c7c29ebfd556a /net/netfilter
parentb3c5163fe0193a74016dba1bb22491e0d1e9aaa4 (diff)
downloadlinux-2bf074825403e0e0d623bac7573580773b78abef.tar.xz
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')
-rw-r--r--net/netfilter/xt_sctp.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/net/netfilter/xt_sctp.c b/net/netfilter/xt_sctp.c
index c04fcf385c59..ef36a56a02c6 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);