mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-07-01 11:21:51 +00:00
[IP_SOCKGLUE]: Remove most of the tcp specific calls
As DCCP needs to be called in the same spots. Now we have a member in inet_sock (is_icsk), set at sock creation time from struct inet_protosw->flags (if INET_PROTOSW_ICSK is set, like for TCP and DCCP) to see if a struct sock instance is a inet_connection_sock for places like the ones in ip_sockglue.c (v4 and v6) where we previously were looking if sk_type was SOCK_STREAM, that is insufficient because we now use the same code for DCCP, that has sk_type SOCK_DCCP. Signed-off-by: Arnaldo Carvalho de Melo <acme@mandriva.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
2271281362
commit
d83d8461f9
20 changed files with 97 additions and 83 deletions
|
@ -220,9 +220,9 @@ int tcp_v4_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len)
|
|||
inet->dport = usin->sin_port;
|
||||
inet->daddr = daddr;
|
||||
|
||||
tp->ext_header_len = 0;
|
||||
inet_csk(sk)->icsk_ext_hdr_len = 0;
|
||||
if (inet->opt)
|
||||
tp->ext_header_len = inet->opt->optlen;
|
||||
inet_csk(sk)->icsk_ext_hdr_len = inet->opt->optlen;
|
||||
|
||||
tp->rx_opt.mss_clamp = 536;
|
||||
|
||||
|
@ -275,7 +275,6 @@ static inline void do_pmtu_discovery(struct sock *sk, struct iphdr *iph,
|
|||
{
|
||||
struct dst_entry *dst;
|
||||
struct inet_sock *inet = inet_sk(sk);
|
||||
struct tcp_sock *tp = tcp_sk(sk);
|
||||
|
||||
/* We are not interested in TCP_LISTEN and open_requests (SYN-ACKs
|
||||
* send out by Linux are always <576bytes so they should go through
|
||||
|
@ -304,7 +303,7 @@ static inline void do_pmtu_discovery(struct sock *sk, struct iphdr *iph,
|
|||
mtu = dst_mtu(dst);
|
||||
|
||||
if (inet->pmtudisc != IP_PMTUDISC_DONT &&
|
||||
tp->pmtu_cookie > mtu) {
|
||||
inet_csk(sk)->icsk_pmtu_cookie > mtu) {
|
||||
tcp_sync_mss(sk, mtu);
|
||||
|
||||
/* Resend the TCP packet because it's
|
||||
|
@ -895,9 +894,9 @@ struct sock *tcp_v4_syn_recv_sock(struct sock *sk, struct sk_buff *skb,
|
|||
ireq->opt = NULL;
|
||||
newinet->mc_index = inet_iif(skb);
|
||||
newinet->mc_ttl = skb->nh.iph->ttl;
|
||||
newtp->ext_header_len = 0;
|
||||
inet_csk(newsk)->icsk_ext_hdr_len = 0;
|
||||
if (newinet->opt)
|
||||
newtp->ext_header_len = newinet->opt->optlen;
|
||||
inet_csk(newsk)->icsk_ext_hdr_len = newinet->opt->optlen;
|
||||
newinet->id = newtp->write_seq ^ jiffies;
|
||||
|
||||
tcp_sync_mss(newsk, dst_mtu(dst));
|
||||
|
@ -1266,6 +1265,7 @@ static int tcp_v4_init_sock(struct sock *sk)
|
|||
sock_set_flag(sk, SOCK_USE_WRITE_QUEUE);
|
||||
|
||||
icsk->icsk_af_ops = &ipv4_specific;
|
||||
icsk->icsk_sync_mss = tcp_sync_mss;
|
||||
|
||||
sk->sk_sndbuf = sysctl_tcp_wmem[1];
|
||||
sk->sk_rcvbuf = sysctl_tcp_rmem[1];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue