From 2aa71d58d1f4b280aaa989b11490ab3a7555365b Mon Sep 17 00:00:00 2001 From: Patrick McHardy Date: Thu, 4 Jan 2007 12:15:34 -0800 Subject: [PATCH] --- yaml --- r: 45217 b: refs/heads/master c: c68b8b687f9e3afff14b88327e17901fff0478ca h: refs/heads/master i: 45215: 446ad210c740c49dd08ced494a8edeb7af63ea59 v: v3 --- [refs] | 2 +- trunk/net/ipv4/netfilter.c | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/[refs] b/[refs] index 50fd99812f3f..3ca200f2e5d0 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: e5b5ef7d2b3fa364cb03407c432ae9979657aa6c +refs/heads/master: c68b8b687f9e3afff14b88327e17901fff0478ca diff --git a/trunk/net/ipv4/netfilter.c b/trunk/net/ipv4/netfilter.c index a68966059b50..c47ce7076bd5 100644 --- a/trunk/net/ipv4/netfilter.c +++ b/trunk/net/ipv4/netfilter.c @@ -15,16 +15,19 @@ int ip_route_me_harder(struct sk_buff **pskb, unsigned addr_type) struct flowi fl = {}; struct dst_entry *odst; unsigned int hh_len; + unsigned int type; + type = inet_addr_type(iph->saddr); if (addr_type == RTN_UNSPEC) - addr_type = inet_addr_type(iph->saddr); + addr_type = type; /* some non-standard hacks like ipt_REJECT.c:send_reset() can cause * packets with foreign saddr to appear on the NF_IP_LOCAL_OUT hook. */ if (addr_type == RTN_LOCAL) { fl.nl_u.ip4_u.daddr = iph->daddr; - fl.nl_u.ip4_u.saddr = iph->saddr; + if (type == RTN_LOCAL) + fl.nl_u.ip4_u.saddr = iph->saddr; fl.nl_u.ip4_u.tos = RT_TOS(iph->tos); fl.oif = (*pskb)->sk ? (*pskb)->sk->sk_bound_dev_if : 0; fl.mark = (*pskb)->mark;