diff options
| author | Ingo Molnar <mingo@elte.hu> | 2011-08-18 21:56:42 +0200 |
|---|---|---|
| committer | Ingo Molnar <mingo@elte.hu> | 2011-08-18 21:56:47 +0200 |
| commit | 8bc84f87315e8bdbe242ba788fdc6a74d653b177 (patch) | |
| tree | b96fef5c82de40cb2a5bfe6f29699f1c820513cd /net/ipv4/netfilter.c | |
| parent | 18e5a45db30e0e338cdd663eda05a8288cc14fa5 (diff) | |
| parent | fe4c51b22080691792d3e28d86acb4d4ccb7e8e8 (diff) | |
| download | talos-op-linux-8bc84f87315e8bdbe242ba788fdc6a74d653b177.tar.gz talos-op-linux-8bc84f87315e8bdbe242ba788fdc6a74d653b177.zip | |
Merge branch 'perf/urgent' into perf/core
Merge reason: add the latest fixes.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'net/ipv4/netfilter.c')
| -rw-r--r-- | net/ipv4/netfilter.c | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/net/ipv4/netfilter.c b/net/ipv4/netfilter.c index 2e97e3ec1eb7..929b27bdeb79 100644 --- a/net/ipv4/netfilter.c +++ b/net/ipv4/netfilter.c @@ -18,17 +18,15 @@ int ip_route_me_harder(struct sk_buff *skb, unsigned addr_type) struct rtable *rt; struct flowi4 fl4 = {}; __be32 saddr = iph->saddr; - __u8 flags = 0; + __u8 flags = skb->sk ? inet_sk_flowi_flags(skb->sk) : 0; unsigned int hh_len; - if (!skb->sk && addr_type != RTN_LOCAL) { - if (addr_type == RTN_UNSPEC) - addr_type = inet_addr_type(net, saddr); - if (addr_type == RTN_LOCAL || addr_type == RTN_UNICAST) - flags |= FLOWI_FLAG_ANYSRC; - else - saddr = 0; - } + if (addr_type == RTN_UNSPEC) + addr_type = inet_addr_type(net, saddr); + if (addr_type == RTN_LOCAL || addr_type == RTN_UNICAST) + flags |= FLOWI_FLAG_ANYSRC; + else + saddr = 0; /* some non-standard hacks like ipt_REJECT.c:send_reset() can cause * packets with foreign saddr to appear on the NF_INET_LOCAL_OUT hook. @@ -38,7 +36,7 @@ int ip_route_me_harder(struct sk_buff *skb, unsigned addr_type) fl4.flowi4_tos = RT_TOS(iph->tos); fl4.flowi4_oif = skb->sk ? skb->sk->sk_bound_dev_if : 0; fl4.flowi4_mark = skb->mark; - fl4.flowi4_flags = skb->sk ? inet_sk_flowi_flags(skb->sk) : flags; + fl4.flowi4_flags = flags; rt = ip_route_output_key(net, &fl4); if (IS_ERR(rt)) return -1; |

