Skip to content

Commit

Permalink
netfilter: xt_sctp: use WORD_ROUND macro to calculate length of multi…
Browse files Browse the repository at this point in the history
…ple 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>
  • Loading branch information
Shan Wei authored and Patrick McHardy committed Jun 9, 2010
1 parent b3c5163 commit 2bf0748
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion net/netfilter/xt_sctp.c
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down Expand Up @@ -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);

Expand Down

0 comments on commit 2bf0748

Please sign in to comment.