summaryrefslogtreecommitdiffstats
path: root/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0026-ipv4-reset-flowi-parameters-on-route-connect.patch
diff options
context:
space:
mode:
authorKoen Kooi <koen@dominion.thruhere.net>2012-03-01 09:35:40 +0100
committerDenys Dmytriyenko <denys@ti.com>2012-03-04 23:35:53 -0500
commit4d6e7c358e61f2053f945423718d0923b6413f99 (patch)
treed2c7ac4906cb51ff7183ab48b497675584c72cfc /recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0026-ipv4-reset-flowi-parameters-on-route-connect.patch
parente31722adc42ef202ae273571ce19a7ac304e5eb6 (diff)
downloadmeta-ti-4d6e7c358e61f2053f945423718d0923b6413f99.tar.gz
linux-ti33x-psp 3.2: update to 3.2.9 and add 2 patches from PSP tree
Signed-off-by: Koen Kooi <koen@dominion.thruhere.net> Signed-off-by: Denys Dmytriyenko <denys@ti.com>
Diffstat (limited to 'recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0026-ipv4-reset-flowi-parameters-on-route-connect.patch')
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0026-ipv4-reset-flowi-parameters-on-route-connect.patch90
1 files changed, 90 insertions, 0 deletions
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0026-ipv4-reset-flowi-parameters-on-route-connect.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0026-ipv4-reset-flowi-parameters-on-route-connect.patch
new file mode 100644
index 00000000..9d576768
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0026-ipv4-reset-flowi-parameters-on-route-connect.patch
@@ -0,0 +1,90 @@
1From f4df037cf3ca933c941a0f87a9c9ec542c88031c Mon Sep 17 00:00:00 2001
2From: Julian Anastasov <ja@ssi.bg>
3Date: Sat, 4 Feb 2012 13:04:46 +0000
4Subject: [PATCH 26/73] ipv4: reset flowi parameters on route connect
5
6[ Upstream commit e6b45241c57a83197e5de9166b3b0d32ac562609 ]
7
8Eric Dumazet found that commit 813b3b5db83
9(ipv4: Use caller's on-stack flowi as-is in output
10route lookups.) that comes in 3.0 added a regression.
11The problem appears to be that resulting flowi4_oif is
12used incorrectly as input parameter to some routing lookups.
13The result is that when connecting to local port without
14listener if the IP address that is used is not on a loopback
15interface we incorrectly assign RTN_UNICAST to the output
16route because no route is matched by oif=lo. The RST packet
17can not be sent immediately by tcp_v4_send_reset because
18it expects RTN_LOCAL.
19
20 So, change ip_route_connect and ip_route_newports to
21update the flowi4 fields that are input parameters because
22we do not want unnecessary binding to oif.
23
24 To make it clear what are the input parameters that
25can be modified during lookup and to show which fields of
26floiw4 are reused add a new function to update the flowi4
27structure: flowi4_update_output.
28
29Thanks to Yurij M. Plotnikov for providing a bug report including a
30program to reproduce the problem.
31
32Thanks to Eric Dumazet for tracking the problem down to
33tcp_v4_send_reset and providing initial fix.
34
35Reported-by: Yurij M. Plotnikov <Yurij.Plotnikov@oktetlabs.ru>
36Signed-off-by: Julian Anastasov <ja@ssi.bg>
37Acked-by: Eric Dumazet <eric.dumazet@gmail.com>
38Signed-off-by: David S. Miller <davem@davemloft.net>
39Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
40---
41 include/net/flow.h | 10 ++++++++++
42 include/net/route.h | 4 ++++
43 2 files changed, 14 insertions(+), 0 deletions(-)
44
45diff --git a/include/net/flow.h b/include/net/flow.h
46index 57f15a7..2a7eefd 100644
47--- a/include/net/flow.h
48+++ b/include/net/flow.h
49@@ -90,6 +90,16 @@ static inline void flowi4_init_output(struct flowi4 *fl4, int oif,
50 fl4->fl4_dport = dport;
51 fl4->fl4_sport = sport;
52 }
53+
54+/* Reset some input parameters after previous lookup */
55+static inline void flowi4_update_output(struct flowi4 *fl4, int oif, __u8 tos,
56+ __be32 daddr, __be32 saddr)
57+{
58+ fl4->flowi4_oif = oif;
59+ fl4->flowi4_tos = tos;
60+ fl4->daddr = daddr;
61+ fl4->saddr = saddr;
62+}
63
64
65 struct flowi6 {
66diff --git a/include/net/route.h b/include/net/route.h
67index 91855d1..b1c0d5b 100644
68--- a/include/net/route.h
69+++ b/include/net/route.h
70@@ -270,6 +270,7 @@ static inline struct rtable *ip_route_connect(struct flowi4 *fl4,
71 if (IS_ERR(rt))
72 return rt;
73 ip_rt_put(rt);
74+ flowi4_update_output(fl4, oif, tos, fl4->daddr, fl4->saddr);
75 }
76 security_sk_classify_flow(sk, flowi4_to_flowi(fl4));
77 return ip_route_output_flow(net, fl4, sk);
78@@ -284,6 +285,9 @@ static inline struct rtable *ip_route_newports(struct flowi4 *fl4, struct rtable
79 fl4->fl4_dport = dport;
80 fl4->fl4_sport = sport;
81 ip_rt_put(rt);
82+ flowi4_update_output(fl4, sk->sk_bound_dev_if,
83+ RT_CONN_FLAGS(sk), fl4->daddr,
84+ fl4->saddr);
85 security_sk_classify_flow(sk, flowi4_to_flowi(fl4));
86 return ip_route_output_flow(sock_net(sk), fl4, sk);
87 }
88--
891.7.7.4
90