aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/net/ip.h4
-rw-r--r--net/ipv4/ip_output.c7
-rw-r--r--net/ipv4/tcp_ipv4.c4
3 files changed, 7 insertions, 8 deletions
diff --git a/include/net/ip.h b/include/net/ip.h
index 0b30d3ab4a30..66dd49149208 100644
--- a/include/net/ip.h
+++ b/include/net/ip.h
@@ -174,8 +174,8 @@ static inline __u8 ip_reply_arg_flowi_flags(const struct ip_reply_arg *arg)
174 return (arg->flags & IP_REPLY_ARG_NOSRCCHECK) ? FLOWI_FLAG_ANYSRC : 0; 174 return (arg->flags & IP_REPLY_ARG_NOSRCCHECK) ? FLOWI_FLAG_ANYSRC : 0;
175} 175}
176 176
177void ip_send_reply(struct sock *sk, struct sk_buff *skb, struct ip_reply_arg *arg, 177void ip_send_reply(struct sock *sk, struct sk_buff *skb, __be32 daddr,
178 unsigned int len); 178 struct ip_reply_arg *arg, unsigned int len);
179 179
180struct ipv4_config { 180struct ipv4_config {
181 int log_martians; 181 int log_martians;
diff --git a/net/ipv4/ip_output.c b/net/ipv4/ip_output.c
index cd89d22902a9..70778d48aa7b 100644
--- a/net/ipv4/ip_output.c
+++ b/net/ipv4/ip_output.c
@@ -1459,20 +1459,19 @@ static int ip_reply_glue_bits(void *dptr, char *to, int offset,
1459 * Should run single threaded per socket because it uses the sock 1459 * Should run single threaded per socket because it uses the sock
1460 * structure to pass arguments. 1460 * structure to pass arguments.
1461 */ 1461 */
1462void ip_send_reply(struct sock *sk, struct sk_buff *skb, struct ip_reply_arg *arg, 1462void ip_send_reply(struct sock *sk, struct sk_buff *skb, __be32 daddr,
1463 unsigned int len) 1463 struct ip_reply_arg *arg, unsigned int len)
1464{ 1464{
1465 struct inet_sock *inet = inet_sk(sk); 1465 struct inet_sock *inet = inet_sk(sk);
1466 struct ip_options_data replyopts; 1466 struct ip_options_data replyopts;
1467 struct ipcm_cookie ipc; 1467 struct ipcm_cookie ipc;
1468 struct flowi4 fl4; 1468 struct flowi4 fl4;
1469 __be32 daddr;
1470 struct rtable *rt = skb_rtable(skb); 1469 struct rtable *rt = skb_rtable(skb);
1471 1470
1472 if (ip_options_echo(&replyopts.opt.opt, skb)) 1471 if (ip_options_echo(&replyopts.opt.opt, skb))
1473 return; 1472 return;
1474 1473
1475 daddr = ipc.addr = rt->rt_src; 1474 ipc.addr = daddr;
1476 ipc.opt = NULL; 1475 ipc.opt = NULL;
1477 ipc.tx_flags = 0; 1476 ipc.tx_flags = 0;
1478 1477
diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c
index 2b655031b392..f67fb34e16e5 100644
--- a/net/ipv4/tcp_ipv4.c
+++ b/net/ipv4/tcp_ipv4.c
@@ -651,7 +651,7 @@ static void tcp_v4_send_reset(struct sock *sk, struct sk_buff *skb)
651 arg.flags = (sk && inet_sk(sk)->transparent) ? IP_REPLY_ARG_NOSRCCHECK : 0; 651 arg.flags = (sk && inet_sk(sk)->transparent) ? IP_REPLY_ARG_NOSRCCHECK : 0;
652 652
653 net = dev_net(skb_dst(skb)->dev); 653 net = dev_net(skb_dst(skb)->dev);
654 ip_send_reply(net->ipv4.tcp_sock, skb, 654 ip_send_reply(net->ipv4.tcp_sock, skb, ip_hdr(skb)->saddr,
655 &arg, arg.iov[0].iov_len); 655 &arg, arg.iov[0].iov_len);
656 656
657 TCP_INC_STATS_BH(net, TCP_MIB_OUTSEGS); 657 TCP_INC_STATS_BH(net, TCP_MIB_OUTSEGS);
@@ -726,7 +726,7 @@ static void tcp_v4_send_ack(struct sk_buff *skb, u32 seq, u32 ack,
726 if (oif) 726 if (oif)
727 arg.bound_dev_if = oif; 727 arg.bound_dev_if = oif;
728 728
729 ip_send_reply(net->ipv4.tcp_sock, skb, 729 ip_send_reply(net->ipv4.tcp_sock, skb, ip_hdr(skb)->saddr,
730 &arg, arg.iov[0].iov_len); 730 &arg, arg.iov[0].iov_len);
731 731
732 TCP_INC_STATS_BH(net, TCP_MIB_OUTSEGS); 732 TCP_INC_STATS_BH(net, TCP_MIB_OUTSEGS);