summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid S. Miller <davem@nuts.ninka.net>2003-08-17 10:06:49 -0700
committerDavid S. Miller <davem@nuts.ninka.net>2003-08-17 10:06:49 -0700
commitf8d1f5ed4de2ab01e0d2d922813a78902a6f1d40 (patch)
treedda92bd7efc8988a59af0be93e77b6fd6e0a9458
parent4c26d765a3636f433b27685cee84717c5d731b65 (diff)
[TCP]: When socket route changes, do not forget to update ext2_header_len and sk_route_caps.
Based upon a patch from Herbert Xu (herbert@gondor.apana.org.au).
-rw-r--r--net/ipv4/tcp_ipv4.c2
-rw-r--r--net/ipv6/tcp_ipv6.c12
2 files changed, 10 insertions, 4 deletions
diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c
index 1a74f72df318..8ca91d91f360 100644
--- a/net/ipv4/tcp_ipv4.c
+++ b/net/ipv4/tcp_ipv4.c
@@ -1884,6 +1884,7 @@ static int tcp_v4_reselect_saddr(struct sock *sk)
__sk_dst_set(sk, &rt->u.dst);
tcp_v4_setup_caps(sk, &rt->u.dst);
+ tcp_sk(sk)->ext2_header_len = rt->u.dst.header_len;
new_saddr = rt->rt_src;
@@ -1943,6 +1944,7 @@ int tcp_v4_rebuild_header(struct sock *sk)
if (!err) {
__sk_dst_set(sk, &rt->u.dst);
tcp_v4_setup_caps(sk, &rt->u.dst);
+ tcp_sk(sk)->ext2_header_len = rt->u.dst.header_len;
return 0;
}
diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c
index 4d16e99a8e84..0f27706023fc 100644
--- a/net/ipv6/tcp_ipv6.c
+++ b/net/ipv6/tcp_ipv6.c
@@ -686,7 +686,7 @@ static int tcp_v6_connect(struct sock *sk, struct sockaddr *uaddr,
ip6_dst_store(sk, dst, NULL);
sk->sk_route_caps = dst->dev->features &
- ~(NETIF_F_IP_CSUM | NETIF_F_TSO);
+ ~(NETIF_F_IP_CSUM | NETIF_F_TSO);
tp->ext_header_len = 0;
if (np->opt)
@@ -1347,8 +1347,8 @@ static struct sock * tcp_v6_syn_recv_sock(struct sock *sk, struct sk_buff *skb,
#endif
ip6_dst_store(newsk, dst, NULL);
- sk->sk_route_caps = dst->dev->features &
- ~(NETIF_F_IP_CSUM | NETIF_F_TSO);
+ newsk->sk_route_caps = dst->dev->features &
+ ~(NETIF_F_IP_CSUM | NETIF_F_TSO);
newtcp6sk = (struct tcp6_sock *)newsk;
newtcp6sk->pinet6 = &newtcp6sk->inet6;
@@ -1741,7 +1741,8 @@ static int tcp_v6_rebuild_header(struct sock *sk)
ip6_dst_store(sk, dst, NULL);
sk->sk_route_caps = dst->dev->features &
- ~(NETIF_F_IP_CSUM | NETIF_F_TSO);
+ ~(NETIF_F_IP_CSUM | NETIF_F_TSO);
+ tcp_sk(sk)->ext2_header_len = dst->header_len;
}
return 0;
@@ -1782,6 +1783,9 @@ static int tcp_v6_xmit(struct sk_buff *skb, int ipfragok)
}
ip6_dst_store(sk, dst, NULL);
+ sk->sk_route_caps = dst->dev->features &
+ ~(NETIF_F_IP_CSUM | NETIF_F_TSO);
+ tcp_sk(sk)->ext2_header_len = dst->header_len;
}
skb->dst = dst_clone(dst);