diff options
author | Koen Kooi <koen@dominion.thruhere.net> | 2012-03-01 09:35:40 +0100 |
---|---|---|
committer | Denys Dmytriyenko <denys@ti.com> | 2012-03-04 23:35:53 -0500 |
commit | 4d6e7c358e61f2053f945423718d0923b6413f99 (patch) | |
tree | d2c7ac4906cb51ff7183ab48b497675584c72cfc /recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0026-ipv4-reset-flowi-parameters-on-route-connect.patch | |
parent | e31722adc42ef202ae273571ce19a7ac304e5eb6 (diff) | |
download | meta-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.patch | 90 |
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 @@ | |||
1 | From f4df037cf3ca933c941a0f87a9c9ec542c88031c Mon Sep 17 00:00:00 2001 | ||
2 | From: Julian Anastasov <ja@ssi.bg> | ||
3 | Date: Sat, 4 Feb 2012 13:04:46 +0000 | ||
4 | Subject: [PATCH 26/73] ipv4: reset flowi parameters on route connect | ||
5 | |||
6 | [ Upstream commit e6b45241c57a83197e5de9166b3b0d32ac562609 ] | ||
7 | |||
8 | Eric Dumazet found that commit 813b3b5db83 | ||
9 | (ipv4: Use caller's on-stack flowi as-is in output | ||
10 | route lookups.) that comes in 3.0 added a regression. | ||
11 | The problem appears to be that resulting flowi4_oif is | ||
12 | used incorrectly as input parameter to some routing lookups. | ||
13 | The result is that when connecting to local port without | ||
14 | listener if the IP address that is used is not on a loopback | ||
15 | interface we incorrectly assign RTN_UNICAST to the output | ||
16 | route because no route is matched by oif=lo. The RST packet | ||
17 | can not be sent immediately by tcp_v4_send_reset because | ||
18 | it expects RTN_LOCAL. | ||
19 | |||
20 | So, change ip_route_connect and ip_route_newports to | ||
21 | update the flowi4 fields that are input parameters because | ||
22 | we do not want unnecessary binding to oif. | ||
23 | |||
24 | To make it clear what are the input parameters that | ||
25 | can be modified during lookup and to show which fields of | ||
26 | floiw4 are reused add a new function to update the flowi4 | ||
27 | structure: flowi4_update_output. | ||
28 | |||
29 | Thanks to Yurij M. Plotnikov for providing a bug report including a | ||
30 | program to reproduce the problem. | ||
31 | |||
32 | Thanks to Eric Dumazet for tracking the problem down to | ||
33 | tcp_v4_send_reset and providing initial fix. | ||
34 | |||
35 | Reported-by: Yurij M. Plotnikov <Yurij.Plotnikov@oktetlabs.ru> | ||
36 | Signed-off-by: Julian Anastasov <ja@ssi.bg> | ||
37 | Acked-by: Eric Dumazet <eric.dumazet@gmail.com> | ||
38 | Signed-off-by: David S. Miller <davem@davemloft.net> | ||
39 | Signed-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 | |||
45 | diff --git a/include/net/flow.h b/include/net/flow.h | ||
46 | index 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 { | ||
66 | diff --git a/include/net/route.h b/include/net/route.h | ||
67 | index 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 | -- | ||
89 | 1.7.7.4 | ||
90 | |||