/* Check if a ack sequence number is a valid syncookie. Return the decoded mss if it is, or 0 if not.  */
static int cookie_check(struct sk_buff *skb, __u32 cookie)
/* Check if a ack sequence number is a valid syncookie. Return the decoded mss if it is, or 0 if not.  */
static int cookie_check(struct sk_buff *skb, __u32 cookie)
{
	const struct iphdr *iph = ip_hdr(skb);
	const struct tcphdr *th = tcp_hdr(skb);
	__u32 seq = ntohl(th->seq) - 1;
	__u32 mssind = check_tcp_syn_cookie(cookie, iph->saddr, iph->daddr,
					    th->source, th->dest, seq,
					    jiffies / (HZ * 60),
					    COUNTER_TRIES);
	return mssind < NUM_MSS ? msstab[mssind] + 1 : 0;
}