net: Fix various endianness glitches
Sparse can help us find endianness bugs, but we need to make some cleanups to be able to more easily spot real bugs. Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
committed by
David S. Miller
parent
cb903bf4ee
commit
0eae88f31c
@@ -861,7 +861,7 @@ static int tcp_transmit_skb(struct sock *sk, struct sk_buff *skb, int clone_it,
|
||||
th->urg_ptr = htons(tp->snd_up - tcb->seq);
|
||||
th->urg = 1;
|
||||
} else if (after(tcb->seq + 0xFFFF, tp->snd_nxt)) {
|
||||
th->urg_ptr = 0xFFFF;
|
||||
th->urg_ptr = htons(0xFFFF);
|
||||
th->urg = 1;
|
||||
}
|
||||
}
|
||||
@@ -2485,7 +2485,7 @@ struct sk_buff *tcp_make_synack(struct sock *sk, struct dst_entry *dst,
|
||||
*tail-- ^= TCP_SKB_CB(skb)->seq + 1;
|
||||
|
||||
/* recommended */
|
||||
*tail-- ^= ((th->dest << 16) | th->source);
|
||||
*tail-- ^= (((__force u32)th->dest << 16) | (__force u32)th->source);
|
||||
*tail-- ^= (u32)(unsigned long)cvp; /* per sockopt */
|
||||
|
||||
sha_transform((__u32 *)&xvp->cookie_bakery[0],
|
||||
|
||||
Reference in New Issue
Block a user