aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv6/tcp_ipv6.c
diff options
context:
space:
mode:
authorEric Dumazet <eric.dumazet@gmail.com>2011-10-24 02:46:04 -0400
committerDavid S. Miller <davem@davemloft.net>2011-10-24 02:46:04 -0400
commit318cf7aaa0a6d20ecf6be33eb771291e5ff2e3b9 (patch)
treea2a42bbea9a1351d9986690f6df2a90cdbfd1d0c /net/ipv6/tcp_ipv6.c
parent8f9f4668b37bcc877156dd525a856055735c8d24 (diff)
tcp: md5: add more const attributes
Now tcp_md5_hash_header() has a const tcphdr argument, we can add more const attributes to callers. Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6/tcp_ipv6.c')
-rw-r--r--net/ipv6/tcp_ipv6.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c
index da2ada881cf..c8683fcc487 100644
--- a/net/ipv6/tcp_ipv6.c
+++ b/net/ipv6/tcp_ipv6.c
@@ -761,7 +761,7 @@ static int tcp_v6_md5_hash_pseudoheader(struct tcp_md5sig_pool *hp,
761 761
762static int tcp_v6_md5_hash_hdr(char *md5_hash, struct tcp_md5sig_key *key, 762static int tcp_v6_md5_hash_hdr(char *md5_hash, struct tcp_md5sig_key *key,
763 const struct in6_addr *daddr, struct in6_addr *saddr, 763 const struct in6_addr *daddr, struct in6_addr *saddr,
764 struct tcphdr *th) 764 const struct tcphdr *th)
765{ 765{
766 struct tcp_md5sig_pool *hp; 766 struct tcp_md5sig_pool *hp;
767 struct hash_desc *desc; 767 struct hash_desc *desc;
@@ -793,13 +793,14 @@ clear_hash_noput:
793} 793}
794 794
795static int tcp_v6_md5_hash_skb(char *md5_hash, struct tcp_md5sig_key *key, 795static int tcp_v6_md5_hash_skb(char *md5_hash, struct tcp_md5sig_key *key,
796 struct sock *sk, struct request_sock *req, 796 const struct sock *sk,
797 struct sk_buff *skb) 797 const struct request_sock *req,
798 const struct sk_buff *skb)
798{ 799{
799 const struct in6_addr *saddr, *daddr; 800 const struct in6_addr *saddr, *daddr;
800 struct tcp_md5sig_pool *hp; 801 struct tcp_md5sig_pool *hp;
801 struct hash_desc *desc; 802 struct hash_desc *desc;
802 struct tcphdr *th = tcp_hdr(skb); 803 const struct tcphdr *th = tcp_hdr(skb);
803 804
804 if (sk) { 805 if (sk) {
805 saddr = &inet6_sk(sk)->saddr; 806 saddr = &inet6_sk(sk)->saddr;
@@ -842,12 +843,12 @@ clear_hash_noput:
842 return 1; 843 return 1;
843} 844}
844 845
845static int tcp_v6_inbound_md5_hash (struct sock *sk, struct sk_buff *skb) 846static int tcp_v6_inbound_md5_hash(struct sock *sk, const struct sk_buff *skb)
846{ 847{
847 const __u8 *hash_location = NULL; 848 const __u8 *hash_location = NULL;
848 struct tcp_md5sig_key *hash_expected; 849 struct tcp_md5sig_key *hash_expected;
849 const struct ipv6hdr *ip6h = ipv6_hdr(skb); 850 const struct ipv6hdr *ip6h = ipv6_hdr(skb);
850 struct tcphdr *th = tcp_hdr(skb); 851 const struct tcphdr *th = tcp_hdr(skb);
851 int genhash; 852 int genhash;
852 u8 newhash[16]; 853 u8 newhash[16];
853 854