Commit 2bf074825403e0e0d623bac7573580773b78abef

Authored by Shan Wei
Committed by Patrick McHardy
1 parent b3c5163fe0

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>

Showing 1 changed file with 2 additions and 1 deletions Side-by-side Diff

net/netfilter/xt_sctp.c
... ... @@ -3,6 +3,7 @@
3 3 #include <linux/skbuff.h>
4 4 #include <net/ip.h>
5 5 #include <net/ipv6.h>
  6 +#include <net/sctp/sctp.h>
6 7 #include <linux/sctp.h>
7 8  
8 9 #include <linux/netfilter/x_tables.h>
... ... @@ -67,7 +68,7 @@
67 68 ++i, offset, sch->type, htons(sch->length),
68 69 sch->flags);
69 70 #endif
70   - offset += (ntohs(sch->length) + 3) & ~3;
  71 + offset += WORD_ROUND(ntohs(sch->length));
71 72  
72 73 pr_debug("skb->len: %d\toffset: %d\n", skb->len, offset);
73 74