diff options
author | Gerrit Renker <gerrit@erg.abdn.ac.uk> | 2006-11-10 17:06:49 -0500 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2006-12-03 00:22:10 -0500 |
commit | a94f723d595ee085f81b1788d18e031af7eeba91 (patch) | |
tree | ce9309a5ba780429bc6e10a2c075af9c9e5b769a /net/ipv6/tcp_ipv6.c | |
parent | 6f4e5fff1e4d46714ea554fd83e44eab534e8b11 (diff) |
[TCP]: Remove dead code in init_sequence
This removes two redundancies:
1) The test (skb->protocol == htons(ETH_P_IPV6) in tcp_v6_init_sequence()
is always true, due to
* tcp_v6_conn_request() is the only function calling this one
* tcp_v6_conn_request() redirects all skb's with ETH_P_IP protocol to
tcp_v4_conn_request() [ cf. top of tcp_v6_conn_request()]
2) The first argument, `struct sock *sk' of tcp_v{4,6}_init_sequence() is
never used.
Signed-off-by: Gerrit Renker <gerrit@erg.abdn.ac.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6/tcp_ipv6.c')
-rw-r--r-- | net/ipv6/tcp_ipv6.c | 19 |
1 files changed, 6 insertions, 13 deletions
diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c index 06b536b47f97..9a8e690fdf7c 100644 --- a/net/ipv6/tcp_ipv6.c +++ b/net/ipv6/tcp_ipv6.c | |||
@@ -106,19 +106,12 @@ static __inline__ u16 tcp_v6_check(struct tcphdr *th, int len, | |||
106 | return csum_ipv6_magic(saddr, daddr, len, IPPROTO_TCP, base); | 106 | return csum_ipv6_magic(saddr, daddr, len, IPPROTO_TCP, base); |
107 | } | 107 | } |
108 | 108 | ||
109 | static __u32 tcp_v6_init_sequence(struct sock *sk, struct sk_buff *skb) | 109 | static __u32 tcp_v6_init_sequence(struct sk_buff *skb) |
110 | { | 110 | { |
111 | if (skb->protocol == htons(ETH_P_IPV6)) { | 111 | return secure_tcpv6_sequence_number(skb->nh.ipv6h->daddr.s6_addr32, |
112 | return secure_tcpv6_sequence_number(skb->nh.ipv6h->daddr.s6_addr32, | 112 | skb->nh.ipv6h->saddr.s6_addr32, |
113 | skb->nh.ipv6h->saddr.s6_addr32, | 113 | skb->h.th->dest, |
114 | skb->h.th->dest, | 114 | skb->h.th->source); |
115 | skb->h.th->source); | ||
116 | } else { | ||
117 | return secure_tcp_sequence_number(skb->nh.iph->daddr, | ||
118 | skb->nh.iph->saddr, | ||
119 | skb->h.th->dest, | ||
120 | skb->h.th->source); | ||
121 | } | ||
122 | } | 115 | } |
123 | 116 | ||
124 | static int tcp_v6_connect(struct sock *sk, struct sockaddr *uaddr, | 117 | static int tcp_v6_connect(struct sock *sk, struct sockaddr *uaddr, |
@@ -822,7 +815,7 @@ static int tcp_v6_conn_request(struct sock *sk, struct sk_buff *skb) | |||
822 | treq->iif = inet6_iif(skb); | 815 | treq->iif = inet6_iif(skb); |
823 | 816 | ||
824 | if (isn == 0) | 817 | if (isn == 0) |
825 | isn = tcp_v6_init_sequence(sk,skb); | 818 | isn = tcp_v6_init_sequence(skb); |
826 | 819 | ||
827 | tcp_rsk(req)->snt_isn = isn; | 820 | tcp_rsk(req)->snt_isn = isn; |
828 | 821 | ||