]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
[TCP]: struct tcp_sack_block annotations
authorAl Viro <viro@zeniv.linux.org.uk>
Wed, 14 Feb 2007 12:58:42 +0000 (13:58 +0100)
committerAdrian Bunk <bunk@stusta.de>
Wed, 14 Feb 2007 12:58:42 +0000 (13:58 +0100)
Some of the instances of tcp_sack_block are host-endian, some - net-endian.
Define struct tcp_sack_block_wire identical to struct tcp_sack_block
with u32 replaced with __be32; annotate uses of tcp_sack_block replacing
net-endian ones with tcp_sack_block_wire.  Change is obviously safe since
for cc(1) __be32 is typedefed to u32.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
include/linux/tcp.h
net/ipv4/netfilter/ip_nat_helper.c
net/ipv4/tcp_input.c

index f2bb2396853f5319000e70bcb9bf71784e933c18..657f2628d23786d5ed89664c44b55d607cbc530d 100644 (file)
@@ -166,6 +166,11 @@ struct tcp_info
 #include <net/inet_timewait_sock.h>
 
 /* This defines a selective acknowledgement block. */
+struct tcp_sack_block_wire {
+       __be32  start_seq;
+       __be32  end_seq;
+};
+
 struct tcp_sack_block {
        __u32   start_seq;
        __u32   end_seq;
index 5d506e0564d5f507b7209ddfea993e68366d52ec..2ba583c795da6f7ecad7d527d58da2b4531f4082 100644 (file)
@@ -268,7 +268,7 @@ sack_adjust(struct sk_buff *skb,
            struct ip_nat_seq *natseq)
 {
        while (sackoff < sackend) {
-               struct tcp_sack_block *sack;
+               struct tcp_sack_block_wire *sack;
                u_int32_t new_start_seq, new_end_seq;
 
                sack = (void *)skb->data + sackoff;
index 408a4fe0b78d055e6611818bcceb9bf2fb1ee965..412e3d214d7cec1974582a83dffe50fbd791433e 100644 (file)
@@ -933,7 +933,7 @@ tcp_sacktag_write_queue(struct sock *sk, struct sk_buff *ack_skb, u32 prior_snd_
        const struct inet_connection_sock *icsk = inet_csk(sk);
        struct tcp_sock *tp = tcp_sk(sk);
        unsigned char *ptr = ack_skb->h.raw + TCP_SKB_CB(ack_skb)->sacked;
-       struct tcp_sack_block *sp = (struct tcp_sack_block *)(ptr+2);
+       struct tcp_sack_block_wire *sp = (struct tcp_sack_block_wire *)(ptr+2);
        int num_sacks = (ptr[1] - TCPOLEN_SACK_BASE)>>3;
        int reord = tp->packets_out;
        int prior_fackets;