aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/tcp_ipv4.c
diff options
context:
space:
mode:
authorYOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>2008-04-16 23:48:12 -0400
committerYOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>2008-06-11 13:38:19 -0400
commit076fb7223357769c39f3ddf900bba6752369c76a (patch)
treedb75c2af3bf71cda4d0cccd6ebcfa8d1a62c3620 /net/ipv4/tcp_ipv4.c
parent7d5d5525bd88313e6fd90c0659665aee5114bc2d (diff)
tcp md5sig: Remove redundant protocol argument.
Protocol is always TCP, so remove useless protocol argument. Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Diffstat (limited to 'net/ipv4/tcp_ipv4.c')
-rw-r--r--net/ipv4/tcp_ipv4.c20
1 files changed, 8 insertions, 12 deletions
diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c
index 56f550933644..f25445d21bdf 100644
--- a/net/ipv4/tcp_ipv4.c
+++ b/net/ipv4/tcp_ipv4.c
@@ -95,8 +95,7 @@ static struct tcp_md5sig_key *tcp_v4_md5_do_lookup(struct sock *sk,
95 __be32 addr); 95 __be32 addr);
96static int tcp_v4_do_calc_md5_hash(char *md5_hash, struct tcp_md5sig_key *key, 96static int tcp_v4_do_calc_md5_hash(char *md5_hash, struct tcp_md5sig_key *key,
97 __be32 saddr, __be32 daddr, 97 __be32 saddr, __be32 daddr,
98 struct tcphdr *th, int protocol, 98 struct tcphdr *th, unsigned int tcplen);
99 unsigned int tcplen);
100#endif 99#endif
101 100
102struct inet_hashinfo __cacheline_aligned tcp_hashinfo = { 101struct inet_hashinfo __cacheline_aligned tcp_hashinfo = {
@@ -586,8 +585,7 @@ static void tcp_v4_send_reset(struct sock *sk, struct sk_buff *skb)
586 key, 585 key,
587 ip_hdr(skb)->daddr, 586 ip_hdr(skb)->daddr,
588 ip_hdr(skb)->saddr, 587 ip_hdr(skb)->saddr,
589 &rep.th, IPPROTO_TCP, 588 &rep.th, arg.iov[0].iov_len);
590 arg.iov[0].iov_len);
591 } 589 }
592#endif 590#endif
593 arg.csum = csum_tcpudp_nofold(ip_hdr(skb)->daddr, 591 arg.csum = csum_tcpudp_nofold(ip_hdr(skb)->daddr,
@@ -680,8 +678,7 @@ static void tcp_v4_send_ack(struct tcp_timewait_sock *twsk,
680 key, 678 key,
681 ip_hdr(skb)->daddr, 679 ip_hdr(skb)->daddr,
682 ip_hdr(skb)->saddr, 680 ip_hdr(skb)->saddr,
683 &rep.th, IPPROTO_TCP, 681 &rep.th, arg.iov[0].iov_len);
684 arg.iov[0].iov_len);
685 } 682 }
686#endif 683#endif
687 arg.csum = csum_tcpudp_nofold(ip_hdr(skb)->daddr, 684 arg.csum = csum_tcpudp_nofold(ip_hdr(skb)->daddr,
@@ -1006,7 +1003,7 @@ static int tcp_v4_parse_md5_keys(struct sock *sk, char __user *optval,
1006 1003
1007static int tcp_v4_do_calc_md5_hash(char *md5_hash, struct tcp_md5sig_key *key, 1004static int tcp_v4_do_calc_md5_hash(char *md5_hash, struct tcp_md5sig_key *key,
1008 __be32 saddr, __be32 daddr, 1005 __be32 saddr, __be32 daddr,
1009 struct tcphdr *th, int protocol, 1006 struct tcphdr *th,
1010 unsigned int tcplen) 1007 unsigned int tcplen)
1011{ 1008{
1012 struct scatterlist sg[4]; 1009 struct scatterlist sg[4];
@@ -1039,7 +1036,7 @@ static int tcp_v4_do_calc_md5_hash(char *md5_hash, struct tcp_md5sig_key *key,
1039 bp->saddr = saddr; 1036 bp->saddr = saddr;
1040 bp->daddr = daddr; 1037 bp->daddr = daddr;
1041 bp->pad = 0; 1038 bp->pad = 0;
1042 bp->protocol = protocol; 1039 bp->protocol = IPPROTO_TCP;
1043 bp->len = htons(tcplen); 1040 bp->len = htons(tcplen);
1044 1041
1045 sg_init_table(sg, 4); 1042 sg_init_table(sg, 4);
@@ -1099,7 +1096,7 @@ int tcp_v4_calc_md5_hash(char *md5_hash, struct tcp_md5sig_key *key,
1099 struct sock *sk, 1096 struct sock *sk,
1100 struct dst_entry *dst, 1097 struct dst_entry *dst,
1101 struct request_sock *req, 1098 struct request_sock *req,
1102 struct tcphdr *th, int protocol, 1099 struct tcphdr *th,
1103 unsigned int tcplen) 1100 unsigned int tcplen)
1104{ 1101{
1105 __be32 saddr, daddr; 1102 __be32 saddr, daddr;
@@ -1115,7 +1112,7 @@ int tcp_v4_calc_md5_hash(char *md5_hash, struct tcp_md5sig_key *key,
1115 } 1112 }
1116 return tcp_v4_do_calc_md5_hash(md5_hash, key, 1113 return tcp_v4_do_calc_md5_hash(md5_hash, key,
1117 saddr, daddr, 1114 saddr, daddr,
1118 th, protocol, tcplen); 1115 th, tcplen);
1119} 1116}
1120 1117
1121EXPORT_SYMBOL(tcp_v4_calc_md5_hash); 1118EXPORT_SYMBOL(tcp_v4_calc_md5_hash);
@@ -1166,8 +1163,7 @@ static int tcp_v4_inbound_md5_hash(struct sock *sk, struct sk_buff *skb)
1166 genhash = tcp_v4_do_calc_md5_hash(newhash, 1163 genhash = tcp_v4_do_calc_md5_hash(newhash,
1167 hash_expected, 1164 hash_expected,
1168 iph->saddr, iph->daddr, 1165 iph->saddr, iph->daddr,
1169 th, sk->sk_protocol, 1166 th, skb->len);
1170 skb->len);
1171 1167
1172 if (genhash || memcmp(hash_location, newhash, 16) != 0) { 1168 if (genhash || memcmp(hash_location, newhash, 16) != 0) {
1173 if (net_ratelimit()) { 1169 if (net_ratelimit()) {