Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2bf07482 authored by Shan Wei's avatar Shan Wei Committed by Patrick McHardy
Browse files

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: default avatarShan Wei <shanwei@cn.fujitsu.com>
Signed-off-by: default avatarPatrick McHardy <kaber@trash.net>
parent b3c5163f
Loading
Loading
Loading
Loading
+2 −1
Original line number Original line Diff line number Diff line
@@ -3,6 +3,7 @@
#include <linux/skbuff.h>
#include <linux/skbuff.h>
#include <net/ip.h>
#include <net/ip.h>
#include <net/ipv6.h>
#include <net/ipv6.h>
#include <net/sctp/sctp.h>
#include <linux/sctp.h>
#include <linux/sctp.h>


#include <linux/netfilter/x_tables.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),
			 ++i, offset, sch->type, htons(sch->length),
			 sch->flags);
			 sch->flags);
#endif
#endif
		offset += (ntohs(sch->length) + 3) & ~3;
		offset += WORD_ROUND(ntohs(sch->length));


		pr_debug("skb->len: %d\toffset: %d\n", skb->len, offset);
		pr_debug("skb->len: %d\toffset: %d\n", skb->len, offset);