diff options
-rw-r--r-- | include/net/ip.h | 1 | ||||
-rw-r--r-- | net/ipv4/ip_output.c | 4 | ||||
-rw-r--r-- | net/ipv4/tcp_ipv4.c | 2 |
3 files changed, 6 insertions, 1 deletions
diff --git a/include/net/ip.h b/include/net/ip.h index bb207db03675..abf2820a1125 100644 --- a/include/net/ip.h +++ b/include/net/ip.h | |||
@@ -143,6 +143,7 @@ struct ip_reply_arg { | |||
143 | __wsum csum; | 143 | __wsum csum; |
144 | int csumoffset; /* u16 offset of csum in iov[0].iov_base */ | 144 | int csumoffset; /* u16 offset of csum in iov[0].iov_base */ |
145 | /* -1 if not needed */ | 145 | /* -1 if not needed */ |
146 | int bound_dev_if; | ||
146 | }; | 147 | }; |
147 | 148 | ||
148 | void ip_send_reply(struct sock *sk, struct sk_buff *skb, struct ip_reply_arg *arg, | 149 | void ip_send_reply(struct sock *sk, struct sk_buff *skb, struct ip_reply_arg *arg, |
diff --git a/net/ipv4/ip_output.c b/net/ipv4/ip_output.c index d6427d918512..34ea4547ebbe 100644 --- a/net/ipv4/ip_output.c +++ b/net/ipv4/ip_output.c | |||
@@ -1352,7 +1352,8 @@ void ip_send_reply(struct sock *sk, struct sk_buff *skb, struct ip_reply_arg *ar | |||
1352 | } | 1352 | } |
1353 | 1353 | ||
1354 | { | 1354 | { |
1355 | struct flowi fl = { .nl_u = { .ip4_u = | 1355 | struct flowi fl = { .oif = arg->bound_dev_if, |
1356 | .nl_u = { .ip4_u = | ||
1356 | { .daddr = daddr, | 1357 | { .daddr = daddr, |
1357 | .saddr = rt->rt_spec_dst, | 1358 | .saddr = rt->rt_spec_dst, |
1358 | .tos = RT_TOS(ip_hdr(skb)->tos) } }, | 1359 | .tos = RT_TOS(ip_hdr(skb)->tos) } }, |
@@ -1376,6 +1377,7 @@ void ip_send_reply(struct sock *sk, struct sk_buff *skb, struct ip_reply_arg *ar | |||
1376 | inet->tos = ip_hdr(skb)->tos; | 1377 | inet->tos = ip_hdr(skb)->tos; |
1377 | sk->sk_priority = skb->priority; | 1378 | sk->sk_priority = skb->priority; |
1378 | sk->sk_protocol = ip_hdr(skb)->protocol; | 1379 | sk->sk_protocol = ip_hdr(skb)->protocol; |
1380 | sk->sk_bound_dev_if = arg->bound_dev_if; | ||
1379 | ip_append_data(sk, ip_reply_glue_bits, arg->iov->iov_base, len, 0, | 1381 | ip_append_data(sk, ip_reply_glue_bits, arg->iov->iov_base, len, 0, |
1380 | &ipc, rt, MSG_DONTWAIT); | 1382 | &ipc, rt, MSG_DONTWAIT); |
1381 | if ((skb = skb_peek(&sk->sk_write_queue)) != NULL) { | 1383 | if ((skb = skb_peek(&sk->sk_write_queue)) != NULL) { |
diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c index 47c61055eb60..97e294e82679 100644 --- a/net/ipv4/tcp_ipv4.c +++ b/net/ipv4/tcp_ipv4.c | |||
@@ -705,6 +705,8 @@ static void tcp_v4_send_ack(struct tcp_timewait_sock *twsk, | |||
705 | ip_hdr(skb)->saddr, /* XXX */ | 705 | ip_hdr(skb)->saddr, /* XXX */ |
706 | arg.iov[0].iov_len, IPPROTO_TCP, 0); | 706 | arg.iov[0].iov_len, IPPROTO_TCP, 0); |
707 | arg.csumoffset = offsetof(struct tcphdr, check) / 2; | 707 | arg.csumoffset = offsetof(struct tcphdr, check) / 2; |
708 | if (twsk) | ||
709 | arg.bound_dev_if = twsk->tw_sk.tw_bound_dev_if; | ||
708 | 710 | ||
709 | ip_send_reply(tcp_socket->sk, skb, &arg, arg.iov[0].iov_len); | 711 | ip_send_reply(tcp_socket->sk, skb, &arg, arg.iov[0].iov_len); |
710 | 712 | ||