diff options
author | YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org> | 2008-01-12 05:16:03 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-01-28 17:59:56 -0500 |
commit | 9cb5734e5b9b26097c7fa28a9c6426a204cc15e3 (patch) | |
tree | a8a098affaa86890b49ce7d52dc365d34213e188 /net | |
parent | c40896de50c73e7835b34f23bea96625edd9d6c4 (diff) |
[TCP]: Convert several length variable to unsigned.
Several length variables cannot be negative, so convert int to
unsigned int. This also allows us to do sane shift operations
on those variables.
Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r-- | net/ipv4/tcp_ipv4.c | 6 | ||||
-rw-r--r-- | net/ipv6/tcp_ipv6.c | 8 |
2 files changed, 7 insertions, 7 deletions
diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c index fc9bdd8b7dc..9aea88b8d4f 100644 --- a/net/ipv4/tcp_ipv4.c +++ b/net/ipv4/tcp_ipv4.c | |||
@@ -99,7 +99,7 @@ static struct tcp_md5sig_key *tcp_v4_md5_do_lookup(struct sock *sk, | |||
99 | static int tcp_v4_do_calc_md5_hash(char *md5_hash, struct tcp_md5sig_key *key, | 99 | static int tcp_v4_do_calc_md5_hash(char *md5_hash, struct tcp_md5sig_key *key, |
100 | __be32 saddr, __be32 daddr, | 100 | __be32 saddr, __be32 daddr, |
101 | struct tcphdr *th, int protocol, | 101 | struct tcphdr *th, int protocol, |
102 | int tcplen); | 102 | unsigned int tcplen); |
103 | #endif | 103 | #endif |
104 | 104 | ||
105 | struct inet_hashinfo __cacheline_aligned tcp_hashinfo = { | 105 | struct inet_hashinfo __cacheline_aligned tcp_hashinfo = { |
@@ -1020,7 +1020,7 @@ static int tcp_v4_parse_md5_keys(struct sock *sk, char __user *optval, | |||
1020 | static int tcp_v4_do_calc_md5_hash(char *md5_hash, struct tcp_md5sig_key *key, | 1020 | static int tcp_v4_do_calc_md5_hash(char *md5_hash, struct tcp_md5sig_key *key, |
1021 | __be32 saddr, __be32 daddr, | 1021 | __be32 saddr, __be32 daddr, |
1022 | struct tcphdr *th, int protocol, | 1022 | struct tcphdr *th, int protocol, |
1023 | int tcplen) | 1023 | unsigned int tcplen) |
1024 | { | 1024 | { |
1025 | struct scatterlist sg[4]; | 1025 | struct scatterlist sg[4]; |
1026 | __u16 data_len; | 1026 | __u16 data_len; |
@@ -1113,7 +1113,7 @@ int tcp_v4_calc_md5_hash(char *md5_hash, struct tcp_md5sig_key *key, | |||
1113 | struct dst_entry *dst, | 1113 | struct dst_entry *dst, |
1114 | struct request_sock *req, | 1114 | struct request_sock *req, |
1115 | struct tcphdr *th, int protocol, | 1115 | struct tcphdr *th, int protocol, |
1116 | int tcplen) | 1116 | unsigned int tcplen) |
1117 | { | 1117 | { |
1118 | __be32 saddr, daddr; | 1118 | __be32 saddr, daddr; |
1119 | 1119 | ||
diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c index 0268e118f0b..00c08399837 100644 --- a/net/ipv6/tcp_ipv6.c +++ b/net/ipv6/tcp_ipv6.c | |||
@@ -733,7 +733,7 @@ static int tcp_v6_do_calc_md5_hash(char *md5_hash, struct tcp_md5sig_key *key, | |||
733 | struct in6_addr *saddr, | 733 | struct in6_addr *saddr, |
734 | struct in6_addr *daddr, | 734 | struct in6_addr *daddr, |
735 | struct tcphdr *th, int protocol, | 735 | struct tcphdr *th, int protocol, |
736 | int tcplen) | 736 | unsigned int tcplen) |
737 | { | 737 | { |
738 | struct scatterlist sg[4]; | 738 | struct scatterlist sg[4]; |
739 | __u16 data_len; | 739 | __u16 data_len; |
@@ -818,7 +818,7 @@ static int tcp_v6_calc_md5_hash(char *md5_hash, struct tcp_md5sig_key *key, | |||
818 | struct dst_entry *dst, | 818 | struct dst_entry *dst, |
819 | struct request_sock *req, | 819 | struct request_sock *req, |
820 | struct tcphdr *th, int protocol, | 820 | struct tcphdr *th, int protocol, |
821 | int tcplen) | 821 | unsigned int tcplen) |
822 | { | 822 | { |
823 | struct in6_addr *saddr, *daddr; | 823 | struct in6_addr *saddr, *daddr; |
824 | 824 | ||
@@ -985,7 +985,7 @@ static void tcp_v6_send_reset(struct sock *sk, struct sk_buff *skb) | |||
985 | struct tcphdr *th = tcp_hdr(skb), *t1; | 985 | struct tcphdr *th = tcp_hdr(skb), *t1; |
986 | struct sk_buff *buff; | 986 | struct sk_buff *buff; |
987 | struct flowi fl; | 987 | struct flowi fl; |
988 | int tot_len = sizeof(*th); | 988 | unsigned int tot_len = sizeof(*th); |
989 | #ifdef CONFIG_TCP_MD5SIG | 989 | #ifdef CONFIG_TCP_MD5SIG |
990 | struct tcp_md5sig_key *key; | 990 | struct tcp_md5sig_key *key; |
991 | #endif | 991 | #endif |
@@ -1085,7 +1085,7 @@ static void tcp_v6_send_ack(struct tcp_timewait_sock *tw, | |||
1085 | struct tcphdr *th = tcp_hdr(skb), *t1; | 1085 | struct tcphdr *th = tcp_hdr(skb), *t1; |
1086 | struct sk_buff *buff; | 1086 | struct sk_buff *buff; |
1087 | struct flowi fl; | 1087 | struct flowi fl; |
1088 | int tot_len = sizeof(struct tcphdr); | 1088 | unsigned int tot_len = sizeof(struct tcphdr); |
1089 | __be32 *topt; | 1089 | __be32 *topt; |
1090 | #ifdef CONFIG_TCP_MD5SIG | 1090 | #ifdef CONFIG_TCP_MD5SIG |
1091 | struct tcp_md5sig_key *key; | 1091 | struct tcp_md5sig_key *key; |