diff options
-rw-r--r-- | net/dccp/ipv4.c | 1 | ||||
-rw-r--r-- | net/ipv4/inet_diag.c | 2 | ||||
-rw-r--r-- | net/ipv4/syncookies.c | 2 | ||||
-rw-r--r-- | net/ipv4/tcp_input.c | 3 | ||||
-rw-r--r-- | net/ipv6/tcp_ipv6.c | 2 |
5 files changed, 7 insertions, 3 deletions
diff --git a/net/dccp/ipv4.c b/net/dccp/ipv4.c index 8f6f4004daac..7f6456afbaec 100644 --- a/net/dccp/ipv4.c +++ b/net/dccp/ipv4.c | |||
@@ -643,6 +643,7 @@ int dccp_v4_conn_request(struct sock *sk, struct sk_buff *skb) | |||
643 | ireq->ir_rmt_addr = ip_hdr(skb)->saddr; | 643 | ireq->ir_rmt_addr = ip_hdr(skb)->saddr; |
644 | write_pnet(&ireq->ireq_net, sock_net(sk)); | 644 | write_pnet(&ireq->ireq_net, sock_net(sk)); |
645 | ireq->ireq_family = AF_INET; | 645 | ireq->ireq_family = AF_INET; |
646 | ireq->ir_iif = sk->sk_bound_dev_if; | ||
646 | 647 | ||
647 | /* | 648 | /* |
648 | * Step 3: Process LISTEN state | 649 | * Step 3: Process LISTEN state |
diff --git a/net/ipv4/inet_diag.c b/net/ipv4/inet_diag.c index 43789c99031f..e1e4d8c0384a 100644 --- a/net/ipv4/inet_diag.c +++ b/net/ipv4/inet_diag.c | |||
@@ -733,7 +733,7 @@ static int inet_diag_fill_req(struct sk_buff *skb, struct sock *sk, | |||
733 | r->idiag_timer = 1; | 733 | r->idiag_timer = 1; |
734 | r->idiag_retrans = req->num_retrans; | 734 | r->idiag_retrans = req->num_retrans; |
735 | 735 | ||
736 | r->id.idiag_if = sk->sk_bound_dev_if; | 736 | r->id.idiag_if = ireq->ir_iif; |
737 | 737 | ||
738 | BUILD_BUG_ON(offsetof(struct inet_request_sock, ir_cookie) != | 738 | BUILD_BUG_ON(offsetof(struct inet_request_sock, ir_cookie) != |
739 | offsetof(struct sock, sk_cookie)); | 739 | offsetof(struct sock, sk_cookie)); |
diff --git a/net/ipv4/syncookies.c b/net/ipv4/syncookies.c index 0c432730c7b4..f17db898ed26 100644 --- a/net/ipv4/syncookies.c +++ b/net/ipv4/syncookies.c | |||
@@ -349,6 +349,8 @@ struct sock *cookie_v4_check(struct sock *sk, struct sk_buff *skb) | |||
349 | write_pnet(&ireq->ireq_net, sock_net(sk)); | 349 | write_pnet(&ireq->ireq_net, sock_net(sk)); |
350 | ireq->ireq_family = AF_INET; | 350 | ireq->ireq_family = AF_INET; |
351 | 351 | ||
352 | ireq->ir_iif = sk->sk_bound_dev_if; | ||
353 | |||
352 | /* We throwed the options of the initial SYN away, so we hope | 354 | /* We throwed the options of the initial SYN away, so we hope |
353 | * the ACK carries the same options again (see RFC1122 4.2.3.8) | 355 | * the ACK carries the same options again (see RFC1122 4.2.3.8) |
354 | */ | 356 | */ |
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c index da61a8e75f68..717d437b6ce1 100644 --- a/net/ipv4/tcp_input.c +++ b/net/ipv4/tcp_input.c | |||
@@ -5967,6 +5967,9 @@ int tcp_conn_request(struct request_sock_ops *rsk_ops, | |||
5967 | tcp_openreq_init(req, &tmp_opt, skb, sk); | 5967 | tcp_openreq_init(req, &tmp_opt, skb, sk); |
5968 | write_pnet(&inet_rsk(req)->ireq_net, sock_net(sk)); | 5968 | write_pnet(&inet_rsk(req)->ireq_net, sock_net(sk)); |
5969 | 5969 | ||
5970 | /* Note: tcp_v6_init_req() might override ir_iif for link locals */ | ||
5971 | inet_rsk(req)->ir_iif = sk->sk_bound_dev_if; | ||
5972 | |||
5970 | af_ops->init_req(req, sk, skb); | 5973 | af_ops->init_req(req, sk, skb); |
5971 | 5974 | ||
5972 | if (security_inet_conn_request(sk, skb, req)) | 5975 | if (security_inet_conn_request(sk, skb, req)) |
diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c index c5fc6a5e4adc..d89f028dc8c4 100644 --- a/net/ipv6/tcp_ipv6.c +++ b/net/ipv6/tcp_ipv6.c | |||
@@ -734,8 +734,6 @@ static void tcp_v6_init_req(struct request_sock *req, struct sock *sk, | |||
734 | ireq->ir_v6_rmt_addr = ipv6_hdr(skb)->saddr; | 734 | ireq->ir_v6_rmt_addr = ipv6_hdr(skb)->saddr; |
735 | ireq->ir_v6_loc_addr = ipv6_hdr(skb)->daddr; | 735 | ireq->ir_v6_loc_addr = ipv6_hdr(skb)->daddr; |
736 | 736 | ||
737 | ireq->ir_iif = sk->sk_bound_dev_if; | ||
738 | |||
739 | /* So that link locals have meaning */ | 737 | /* So that link locals have meaning */ |
740 | if (!sk->sk_bound_dev_if && | 738 | if (!sk->sk_bound_dev_if && |
741 | ipv6_addr_type(&ireq->ir_v6_rmt_addr) & IPV6_ADDR_LINKLOCAL) | 739 | ipv6_addr_type(&ireq->ir_v6_rmt_addr) & IPV6_ADDR_LINKLOCAL) |