diff options
author | YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org> | 2008-04-16 23:48:12 -0400 |
---|---|---|
committer | YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org> | 2008-06-11 13:38:19 -0400 |
commit | 076fb7223357769c39f3ddf900bba6752369c76a (patch) | |
tree | db75c2af3bf71cda4d0cccd6ebcfa8d1a62c3620 /net/ipv6/tcp_ipv6.c | |
parent | 7d5d5525bd88313e6fd90c0659665aee5114bc2d (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/ipv6/tcp_ipv6.c')
-rw-r--r-- | net/ipv6/tcp_ipv6.c | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c index dd4ddb30a3a9..334d21c23da9 100644 --- a/net/ipv6/tcp_ipv6.c +++ b/net/ipv6/tcp_ipv6.c | |||
@@ -736,8 +736,7 @@ static int tcp_v6_parse_md5_keys (struct sock *sk, char __user *optval, | |||
736 | static int tcp_v6_do_calc_md5_hash(char *md5_hash, struct tcp_md5sig_key *key, | 736 | static int tcp_v6_do_calc_md5_hash(char *md5_hash, struct tcp_md5sig_key *key, |
737 | struct in6_addr *saddr, | 737 | struct in6_addr *saddr, |
738 | struct in6_addr *daddr, | 738 | struct in6_addr *daddr, |
739 | struct tcphdr *th, int protocol, | 739 | struct tcphdr *th, unsigned int tcplen) |
740 | unsigned int tcplen) | ||
741 | { | 740 | { |
742 | struct scatterlist sg[4]; | 741 | struct scatterlist sg[4]; |
743 | __u16 data_len; | 742 | __u16 data_len; |
@@ -761,7 +760,7 @@ static int tcp_v6_do_calc_md5_hash(char *md5_hash, struct tcp_md5sig_key *key, | |||
761 | ipv6_addr_copy(&bp->saddr, saddr); | 760 | ipv6_addr_copy(&bp->saddr, saddr); |
762 | ipv6_addr_copy(&bp->daddr, daddr); | 761 | ipv6_addr_copy(&bp->daddr, daddr); |
763 | bp->len = htonl(tcplen); | 762 | bp->len = htonl(tcplen); |
764 | bp->protocol = htonl(protocol); | 763 | bp->protocol = htonl(IPPROTO_TCP); |
765 | 764 | ||
766 | sg_init_table(sg, 4); | 765 | sg_init_table(sg, 4); |
767 | 766 | ||
@@ -821,8 +820,7 @@ static int tcp_v6_calc_md5_hash(char *md5_hash, struct tcp_md5sig_key *key, | |||
821 | struct sock *sk, | 820 | struct sock *sk, |
822 | struct dst_entry *dst, | 821 | struct dst_entry *dst, |
823 | struct request_sock *req, | 822 | struct request_sock *req, |
824 | struct tcphdr *th, int protocol, | 823 | struct tcphdr *th, unsigned int tcplen) |
825 | unsigned int tcplen) | ||
826 | { | 824 | { |
827 | struct in6_addr *saddr, *daddr; | 825 | struct in6_addr *saddr, *daddr; |
828 | 826 | ||
@@ -835,7 +833,7 @@ static int tcp_v6_calc_md5_hash(char *md5_hash, struct tcp_md5sig_key *key, | |||
835 | } | 833 | } |
836 | return tcp_v6_do_calc_md5_hash(md5_hash, key, | 834 | return tcp_v6_do_calc_md5_hash(md5_hash, key, |
837 | saddr, daddr, | 835 | saddr, daddr, |
838 | th, protocol, tcplen); | 836 | th, tcplen); |
839 | } | 837 | } |
840 | 838 | ||
841 | static int tcp_v6_inbound_md5_hash (struct sock *sk, struct sk_buff *skb) | 839 | static int tcp_v6_inbound_md5_hash (struct sock *sk, struct sk_buff *skb) |
@@ -879,8 +877,7 @@ static int tcp_v6_inbound_md5_hash (struct sock *sk, struct sk_buff *skb) | |||
879 | genhash = tcp_v6_do_calc_md5_hash(newhash, | 877 | genhash = tcp_v6_do_calc_md5_hash(newhash, |
880 | hash_expected, | 878 | hash_expected, |
881 | &ip6h->saddr, &ip6h->daddr, | 879 | &ip6h->saddr, &ip6h->daddr, |
882 | th, sk->sk_protocol, | 880 | th, skb->len); |
883 | skb->len); | ||
884 | if (genhash || memcmp(hash_location, newhash, 16) != 0) { | 881 | if (genhash || memcmp(hash_location, newhash, 16) != 0) { |
885 | if (net_ratelimit()) { | 882 | if (net_ratelimit()) { |
886 | printk(KERN_INFO "MD5 Hash %s for " | 883 | printk(KERN_INFO "MD5 Hash %s for " |
@@ -1020,7 +1017,7 @@ static void tcp_v6_send_reset(struct sock *sk, struct sk_buff *skb) | |||
1020 | tcp_v6_do_calc_md5_hash((__u8 *)&opt[1], key, | 1017 | tcp_v6_do_calc_md5_hash((__u8 *)&opt[1], key, |
1021 | &ipv6_hdr(skb)->daddr, | 1018 | &ipv6_hdr(skb)->daddr, |
1022 | &ipv6_hdr(skb)->saddr, | 1019 | &ipv6_hdr(skb)->saddr, |
1023 | t1, IPPROTO_TCP, tot_len); | 1020 | t1, tot_len); |
1024 | } | 1021 | } |
1025 | #endif | 1022 | #endif |
1026 | 1023 | ||
@@ -1126,7 +1123,7 @@ static void tcp_v6_send_ack(struct tcp_timewait_sock *tw, | |||
1126 | tcp_v6_do_calc_md5_hash((__u8 *)topt, key, | 1123 | tcp_v6_do_calc_md5_hash((__u8 *)topt, key, |
1127 | &ipv6_hdr(skb)->daddr, | 1124 | &ipv6_hdr(skb)->daddr, |
1128 | &ipv6_hdr(skb)->saddr, | 1125 | &ipv6_hdr(skb)->saddr, |
1129 | t1, IPPROTO_TCP, tot_len); | 1126 | t1, tot_len); |
1130 | } | 1127 | } |
1131 | #endif | 1128 | #endif |
1132 | 1129 | ||