-diff -urp v2.6.34/linux/include/linux/rtnetlink.h linux/include/linux/rtnetlink.h
---- v2.6.34/linux/include/linux/rtnetlink.h 2010-05-17 10:49:00.000000000 +0300
-+++ linux/include/linux/rtnetlink.h 2010-05-18 09:58:49.000000000 +0300
-@@ -304,6 +304,8 @@ struct rtnexthop {
+diff -urp v2.6.35/linux/include/linux/rtnetlink.h linux/include/linux/rtnetlink.h
+--- v2.6.35/linux/include/linux/rtnetlink.h 2010-08-02 09:37:48.000000000 +0300
++++ linux/include/linux/rtnetlink.h 2010-08-03 00:24:10.000000000 +0300
+@@ -311,6 +311,8 @@ struct rtnexthop {
#define RTNH_F_DEAD 1 /* Nexthop is dead (used by multipath) */
#define RTNH_F_PERVASIVE 2 /* Do recursive gateway lookup */
#define RTNH_F_ONLINK 4 /* Gateway is forced on link */
/* Macros to handle hexthops */
-diff -urp v2.6.34/linux/include/net/flow.h linux/include/net/flow.h
---- v2.6.34/linux/include/net/flow.h 2009-03-25 09:48:32.000000000 +0200
-+++ linux/include/net/flow.h 2010-05-18 09:58:49.000000000 +0300
+diff -urp v2.6.35/linux/include/net/flow.h linux/include/net/flow.h
+--- v2.6.35/linux/include/net/flow.h 2010-08-02 09:37:48.000000000 +0300
++++ linux/include/net/flow.h 2010-08-03 00:24:45.000000000 +0300
@@ -19,6 +19,8 @@ struct flowi {
struct {
__be32 daddr;
#define fl4_tos nl_u.ip4_u.tos
#define fl4_scope nl_u.ip4_u.scope
-diff -urp v2.6.34/linux/include/net/ip_fib.h linux/include/net/ip_fib.h
---- v2.6.34/linux/include/net/ip_fib.h 2010-02-25 09:01:36.000000000 +0200
-+++ linux/include/net/ip_fib.h 2010-05-18 09:58:49.000000000 +0300
+diff -urp v2.6.35/linux/include/net/ip_fib.h linux/include/net/ip_fib.h
+--- v2.6.35/linux/include/net/ip_fib.h 2010-02-25 09:01:36.000000000 +0200
++++ linux/include/net/ip_fib.h 2010-08-03 00:24:10.000000000 +0300
@@ -207,6 +207,8 @@ extern int fib_lookup(struct net *n, str
extern struct fib_table *fib_new_table(struct net *net, u32 id);
extern struct fib_table *fib_get_table(struct net *net, u32 id);
+extern rwlock_t fib_nhflags_lock;
+
#endif /* _NET_FIB_H */
-diff -urp v2.6.34/linux/include/net/netfilter/nf_nat.h linux/include/net/netfilter/nf_nat.h
---- v2.6.34/linux/include/net/netfilter/nf_nat.h 2010-02-25 09:01:36.000000000 +0200
-+++ linux/include/net/netfilter/nf_nat.h 2010-05-18 09:58:49.000000000 +0300
+diff -urp v2.6.35/linux/include/net/netfilter/nf_nat.h linux/include/net/netfilter/nf_nat.h
+--- v2.6.35/linux/include/net/netfilter/nf_nat.h 2010-02-25 09:01:36.000000000 +0200
++++ linux/include/net/netfilter/nf_nat.h 2010-08-03 00:24:45.000000000 +0300
@@ -73,6 +73,13 @@ struct nf_conn_nat {
#endif
};
/* Set up the info structure to map into this range. */
extern unsigned int nf_nat_setup_info(struct nf_conn *ct,
const struct nf_nat_range *range,
-diff -urp v2.6.34/linux/include/net/route.h linux/include/net/route.h
---- v2.6.34/linux/include/net/route.h 2010-05-17 10:49:00.000000000 +0300
-+++ linux/include/net/route.h 2010-05-18 09:58:49.000000000 +0300
-@@ -113,6 +113,7 @@ extern int __ip_route_output_key(struct
- extern int ip_route_output_key(struct net *, struct rtable **, struct flowi *flp);
- extern int ip_route_output_flow(struct net *, struct rtable **rp, struct flowi *flp, struct sock *sk, int flags);
- extern int ip_route_input(struct sk_buff*, __be32 dst, __be32 src, u8 tos, struct net_device *devin);
+diff -urp v2.6.35/linux/include/net/route.h linux/include/net/route.h
+--- v2.6.35/linux/include/net/route.h 2010-08-02 09:37:48.000000000 +0300
++++ linux/include/net/route.h 2010-08-03 00:26:00.000000000 +0300
+@@ -128,6 +128,7 @@ static inline int ip_route_input_noref(s
+ return ip_route_input_common(skb, dst, src, tos, devin, true);
+ }
+
+extern int ip_route_input_lookup(struct sk_buff*, __be32 dst, __be32 src, u8 tos, struct net_device *devin, __be32 lsrc);
extern unsigned short ip_rt_frag_needed(struct net *net, struct iphdr *iph, unsigned short new_mtu, struct net_device *dev);
extern void ip_rt_send_redirect(struct sk_buff *skb);
-diff -urp v2.6.34/linux/net/bridge/br_netfilter.c linux/net/bridge/br_netfilter.c
---- v2.6.34/linux/net/bridge/br_netfilter.c 2010-05-17 10:49:01.000000000 +0300
-+++ linux/net/bridge/br_netfilter.c 2010-05-18 09:58:49.000000000 +0300
-@@ -344,6 +344,9 @@ static int br_nf_pre_routing_finish(stru
+diff -urp v2.6.35/linux/net/bridge/br_netfilter.c linux/net/bridge/br_netfilter.c
+--- v2.6.35/linux/net/bridge/br_netfilter.c 2010-08-02 09:37:49.000000000 +0300
++++ linux/net/bridge/br_netfilter.c 2010-08-03 00:24:45.000000000 +0300
+@@ -334,6 +334,9 @@ static int br_nf_pre_routing_finish(stru
struct rtable *rt;
int err;
if (nf_bridge->mask & BRNF_PKT_TYPE) {
skb->pkt_type = PACKET_OTHERHOST;
nf_bridge->mask ^= BRNF_PKT_TYPE;
-diff -urp v2.6.34/linux/net/ipv4/fib_frontend.c linux/net/ipv4/fib_frontend.c
---- v2.6.34/linux/net/ipv4/fib_frontend.c 2010-05-17 10:49:01.000000000 +0300
-+++ linux/net/ipv4/fib_frontend.c 2010-05-18 09:58:49.000000000 +0300
+diff -urp v2.6.35/linux/net/ipv4/fib_frontend.c linux/net/ipv4/fib_frontend.c
+--- v2.6.35/linux/net/ipv4/fib_frontend.c 2010-05-17 10:49:01.000000000 +0300
++++ linux/net/ipv4/fib_frontend.c 2010-08-03 00:24:10.000000000 +0300
@@ -47,6 +47,8 @@
#ifndef CONFIG_IP_MULTIPLE_TABLES
rt_cache_flush(dev_net(dev), -1);
break;
case NETDEV_DOWN:
-diff -urp v2.6.34/linux/net/ipv4/fib_hash.c linux/net/ipv4/fib_hash.c
---- v2.6.34/linux/net/ipv4/fib_hash.c 2010-05-17 10:49:01.000000000 +0300
-+++ linux/net/ipv4/fib_hash.c 2010-05-18 09:58:49.000000000 +0300
+diff -urp v2.6.35/linux/net/ipv4/fib_hash.c linux/net/ipv4/fib_hash.c
+--- v2.6.35/linux/net/ipv4/fib_hash.c 2010-05-17 10:49:01.000000000 +0300
++++ linux/net/ipv4/fib_hash.c 2010-08-03 00:24:10.000000000 +0300
@@ -278,25 +278,35 @@ out:
void fib_table_select_default(struct fib_table *tb,
const struct flowi *flp, struct fib_result *res)
/*
* Insert new entry to the list.
-diff -urp v2.6.34/linux/net/ipv4/fib_lookup.h linux/net/ipv4/fib_lookup.h
---- v2.6.34/linux/net/ipv4/fib_lookup.h 2009-09-11 10:27:17.000000000 +0300
-+++ linux/net/ipv4/fib_lookup.h 2010-05-18 09:58:49.000000000 +0300
+diff -urp v2.6.35/linux/net/ipv4/fib_lookup.h linux/net/ipv4/fib_lookup.h
+--- v2.6.35/linux/net/ipv4/fib_lookup.h 2009-09-11 10:27:17.000000000 +0300
++++ linux/net/ipv4/fib_lookup.h 2010-08-03 00:24:10.000000000 +0300
@@ -8,6 +8,7 @@
struct fib_alias {
struct list_head fa_list;
static inline void fib_result_assign(struct fib_result *res,
struct fib_info *fi)
-diff -urp v2.6.34/linux/net/ipv4/fib_rules.c linux/net/ipv4/fib_rules.c
---- v2.6.34/linux/net/ipv4/fib_rules.c 2010-02-25 09:01:36.000000000 +0200
-+++ linux/net/ipv4/fib_rules.c 2010-05-18 09:58:49.000000000 +0300
+diff -urp v2.6.35/linux/net/ipv4/fib_rules.c linux/net/ipv4/fib_rules.c
+--- v2.6.35/linux/net/ipv4/fib_rules.c 2010-08-02 09:37:49.000000000 +0300
++++ linux/net/ipv4/fib_rules.c 2010-08-03 00:24:10.000000000 +0300
@@ -54,6 +54,11 @@ u32 fib_rules_tclass(struct fib_result *
}
#endif
int fib_lookup(struct net *net, struct flowi *flp, struct fib_result *res)
{
struct fib_lookup_arg arg = {
-diff -urp v2.6.34/linux/net/ipv4/fib_semantics.c linux/net/ipv4/fib_semantics.c
---- v2.6.34/linux/net/ipv4/fib_semantics.c 2010-05-17 10:49:01.000000000 +0300
-+++ linux/net/ipv4/fib_semantics.c 2010-05-18 09:58:49.000000000 +0300
+diff -urp v2.6.35/linux/net/ipv4/fib_semantics.c linux/net/ipv4/fib_semantics.c
+--- v2.6.35/linux/net/ipv4/fib_semantics.c 2010-05-17 10:49:01.000000000 +0300
++++ linux/net/ipv4/fib_semantics.c 2010-08-03 00:24:45.000000000 +0300
@@ -51,6 +51,7 @@ static struct hlist_head *fib_info_hash;
static struct hlist_head *fib_info_laddrhash;
static unsigned int fib_hash_size;
spin_unlock_bh(&fib_multipath_lock);
}
#endif
-diff -urp v2.6.34/linux/net/ipv4/fib_trie.c linux/net/ipv4/fib_trie.c
---- v2.6.34/linux/net/ipv4/fib_trie.c 2010-05-17 10:49:01.000000000 +0300
-+++ linux/net/ipv4/fib_trie.c 2010-05-18 09:58:49.000000000 +0300
-@@ -1277,6 +1277,7 @@ int fib_table_insert(struct fib_table *t
+diff -urp v2.6.35/linux/net/ipv4/fib_trie.c linux/net/ipv4/fib_trie.c
+--- v2.6.35/linux/net/ipv4/fib_trie.c 2010-08-02 09:37:49.000000000 +0300
++++ linux/net/ipv4/fib_trie.c 2010-08-03 00:24:10.000000000 +0300
+@@ -1275,6 +1275,7 @@ int fib_table_insert(struct fib_table *t
fi_drop = fa->fa_info;
new_fa->fa_tos = fa->fa_tos;
new_fa->fa_info = fi;
new_fa->fa_type = cfg->fc_type;
new_fa->fa_scope = cfg->fc_scope;
state = fa->fa_state;
-@@ -1317,6 +1318,7 @@ int fib_table_insert(struct fib_table *t
+@@ -1315,6 +1316,7 @@ int fib_table_insert(struct fib_table *t
new_fa->fa_type = cfg->fc_type;
new_fa->fa_scope = cfg->fc_scope;
new_fa->fa_state = 0;
/*
* Insert new entry to the list.
*/
-@@ -1817,24 +1819,31 @@ void fib_table_select_default(struct fib
+@@ -1815,24 +1817,31 @@ void fib_table_select_default(struct fib
struct fib_result *res)
{
struct trie *t = (struct trie *) tb->tb_data;
if (!fa_head)
goto out;
-@@ -1848,39 +1857,52 @@ void fib_table_select_default(struct fib
+@@ -1846,39 +1855,52 @@ void fib_table_select_default(struct fib
fa->fa_type != RTN_UNICAST)
continue;
out:
rcu_read_unlock();
}
-diff -urp v2.6.34/linux/net/ipv4/netfilter/ipt_MASQUERADE.c linux/net/ipv4/netfilter/ipt_MASQUERADE.c
---- v2.6.34/linux/net/ipv4/netfilter/ipt_MASQUERADE.c 2010-02-25 09:01:36.000000000 +0200
-+++ linux/net/ipv4/netfilter/ipt_MASQUERADE.c 2010-05-18 09:58:49.000000000 +0300
+diff -urp v2.6.35/linux/net/ipv4/netfilter/ipt_MASQUERADE.c linux/net/ipv4/netfilter/ipt_MASQUERADE.c
+--- v2.6.35/linux/net/ipv4/netfilter/ipt_MASQUERADE.c 2010-08-02 09:37:49.000000000 +0300
++++ linux/net/ipv4/netfilter/ipt_MASQUERADE.c 2010-08-03 00:26:47.000000000 +0300
@@ -51,7 +51,7 @@ masquerade_tg(struct sk_buff *skb, const
enum ip_conntrack_info ctinfo;
struct nf_nat_range newrange;
__be32 newsrc;
NF_CT_ASSERT(par->hooknum == NF_INET_POST_ROUTING);
-@@ -69,13 +69,28 @@ masquerade_tg(struct sk_buff *skb, const
+@@ -69,13 +69,29 @@ masquerade_tg(struct sk_buff *skb, const
return NF_ACCEPT;
mr = par->targinfo;
- rt = skb_rtable(skb);
- newsrc = inet_select_addr(par->out, rt->rt_gateway, RT_SCOPE_UNIVERSE);
- if (!newsrc) {
-- printk("MASQUERADE: %s ate my IP address\n", par->out->name);
+- pr_info("%s ate my IP address\n", par->out->name);
- return NF_DROP;
+
+ {
+ if (ip_route_output_key(dev_net(par->out), &rt, &fl) != 0) {
+ /* Funky routing can do this. */
+ if (net_ratelimit())
-+ printk("MASQUERADE:"
-+ " No route: Rusty's brain broke!\n");
++ pr_info("%s:"
++ " No route: Rusty's brain broke!\n",
++ par->out->name);
+ return NF_DROP;
+ }
}
nat->masq_index = par->out->ifindex;
/* Transfer from original range. */
-diff -urp v2.6.34/linux/net/ipv4/netfilter/nf_nat_core.c linux/net/ipv4/netfilter/nf_nat_core.c
---- v2.6.34/linux/net/ipv4/netfilter/nf_nat_core.c 2010-05-17 10:49:01.000000000 +0300
-+++ linux/net/ipv4/netfilter/nf_nat_core.c 2010-05-18 09:58:49.000000000 +0300
+diff -urp v2.6.35/linux/net/ipv4/netfilter/nf_nat_core.c linux/net/ipv4/netfilter/nf_nat_core.c
+--- v2.6.35/linux/net/ipv4/netfilter/nf_nat_core.c 2010-05-17 10:49:01.000000000 +0300
++++ linux/net/ipv4/netfilter/nf_nat_core.c 2010-08-03 00:24:45.000000000 +0300
@@ -715,6 +715,52 @@ static struct pernet_operations nf_nat_n
.exit = nf_nat_net_exit,
};
static int __init nf_nat_init(void)
{
size_t i;
-diff -urp v2.6.34/linux/net/ipv4/netfilter/nf_nat_standalone.c linux/net/ipv4/netfilter/nf_nat_standalone.c
---- v2.6.34/linux/net/ipv4/netfilter/nf_nat_standalone.c 2010-05-17 10:49:01.000000000 +0300
-+++ linux/net/ipv4/netfilter/nf_nat_standalone.c 2010-05-18 09:58:49.000000000 +0300
-@@ -256,6 +256,14 @@ static struct nf_hook_ops nf_nat_ops[] _
+diff -urp v2.6.35/linux/net/ipv4/netfilter/nf_nat_standalone.c linux/net/ipv4/netfilter/nf_nat_standalone.c
+--- v2.6.35/linux/net/ipv4/netfilter/nf_nat_standalone.c 2010-08-02 09:37:49.000000000 +0300
++++ linux/net/ipv4/netfilter/nf_nat_standalone.c 2010-08-03 00:24:45.000000000 +0300
+@@ -255,6 +255,14 @@ static struct nf_hook_ops nf_nat_ops[] _
.hooknum = NF_INET_PRE_ROUTING,
.priority = NF_IP_PRI_NAT_DST,
},
/* After packet filtering, change source */
{
.hook = nf_nat_out,
-diff -urp v2.6.34/linux/net/ipv4/route.c linux/net/ipv4/route.c
---- v2.6.34/linux/net/ipv4/route.c 2010-05-17 10:49:01.000000000 +0300
-+++ linux/net/ipv4/route.c 2010-05-18 09:58:49.000000000 +0300
-@@ -695,6 +695,8 @@ static inline int compare_keys(struct fl
- return ((__force u32)((fl1->nl_u.ip4_u.daddr ^ fl2->nl_u.ip4_u.daddr) |
- (fl1->nl_u.ip4_u.saddr ^ fl2->nl_u.ip4_u.saddr)) |
+diff -urp v2.6.35/linux/net/ipv4/route.c linux/net/ipv4/route.c
+--- v2.6.35/linux/net/ipv4/route.c 2010-08-02 09:37:49.000000000 +0300
++++ linux/net/ipv4/route.c 2010-08-03 00:32:04.000000000 +0300
+@@ -694,6 +694,8 @@ static inline int compare_keys(struct fl
+ return (((__force u32)fl1->nl_u.ip4_u.daddr ^ (__force u32)fl2->nl_u.ip4_u.daddr) |
+ ((__force u32)fl1->nl_u.ip4_u.saddr ^ (__force u32)fl2->nl_u.ip4_u.saddr) |
(fl1->mark ^ fl2->mark) |
-+ ((__force u32)(fl1->nl_u.ip4_u.lsrc ^ fl2->nl_u.ip4_u.lsrc)) |
-+ ((__force u32)(fl1->nl_u.ip4_u.gw ^ fl2->nl_u.ip4_u.gw)) |
- (*(u16 *)&fl1->nl_u.ip4_u.tos ^
- *(u16 *)&fl2->nl_u.ip4_u.tos) |
++ ((__force u32)fl1->nl_u.ip4_u.lsrc ^ (__force u32)fl2->nl_u.ip4_u.lsrc) |
++ ((__force u32)fl1->nl_u.ip4_u.gw ^ (__force u32)fl2->nl_u.ip4_u.gw) |
+ (*(u16 *)&fl1->nl_u.ip4_u.tos ^ *(u16 *)&fl2->nl_u.ip4_u.tos) |
(fl1->oif ^ fl2->oif) |
-@@ -1460,6 +1462,7 @@ void ip_rt_redirect(__be32 old_gw, __be3
+ (fl1->iif ^ fl2->iif)) == 0;
+@@ -1437,6 +1439,7 @@ void ip_rt_redirect(__be32 old_gw, __be3
/* Gateway is different ... */
rt->rt_gateway = new_gw;
/* Redirect received -> path was valid */
dst_confirm(&rth->u.dst);
-@@ -1909,6 +1912,7 @@ static int ip_route_input_mc(struct sk_b
+@@ -1886,6 +1889,7 @@ static int ip_route_input_mc(struct sk_b
rth->fl.fl4_tos = tos;
rth->fl.mark = skb->mark;
rth->fl.fl4_src = saddr;
rth->rt_src = saddr;
#ifdef CONFIG_NET_CLS_ROUTE
rth->u.dst.tclassid = itag;
-@@ -1919,6 +1923,7 @@ static int ip_route_input_mc(struct sk_b
+@@ -1896,6 +1900,7 @@ static int ip_route_input_mc(struct sk_b
dev_hold(rth->u.dst.dev);
rth->idev = in_dev_get(rth->u.dst.dev);
rth->fl.oif = 0;
rth->rt_gateway = daddr;
rth->rt_spec_dst= spec_dst;
rth->rt_genid = rt_genid(dev_net(dev));
-@@ -1983,7 +1988,7 @@ static int __mkroute_input(struct sk_buf
+@@ -1960,7 +1965,7 @@ static int __mkroute_input(struct sk_buf
struct fib_result *res,
struct in_device *in_dev,
__be32 daddr, __be32 saddr, u32 tos,
{
struct rtable *rth;
-@@ -2017,6 +2022,7 @@ static int __mkroute_input(struct sk_buf
+@@ -1994,6 +1999,7 @@ static int __mkroute_input(struct sk_buf
flags |= RTCF_DIRECTSRC;
if (out_dev == in_dev && err &&
(IN_DEV_SHARED_MEDIA(out_dev) ||
inet_addr_onlink(out_dev, saddr, FIB_RES_GW(*res))))
flags |= RTCF_DOREDIRECT;
-@@ -2055,6 +2061,7 @@ static int __mkroute_input(struct sk_buf
+@@ -2032,6 +2038,7 @@ static int __mkroute_input(struct sk_buf
rth->fl.mark = skb->mark;
rth->fl.fl4_src = saddr;
rth->rt_src = saddr;
rth->rt_gateway = daddr;
rth->rt_iif =
rth->fl.iif = in_dev->dev->ifindex;
-@@ -2062,6 +2069,7 @@ static int __mkroute_input(struct sk_buf
+@@ -2039,6 +2046,7 @@ static int __mkroute_input(struct sk_buf
dev_hold(rth->u.dst.dev);
rth->idev = in_dev_get(rth->u.dst.dev);
rth->fl.oif = 0;
rth->rt_spec_dst= spec_dst;
rth->u.dst.obsolete = -1;
-@@ -2083,21 +2091,23 @@ static int __mkroute_input(struct sk_buf
+@@ -2060,21 +2068,23 @@ static int __mkroute_input(struct sk_buf
static int ip_mkroute_input(struct sk_buff *skb,
struct fib_result *res,
if (err)
return err;
-@@ -2118,18 +2128,19 @@ static int ip_mkroute_input(struct sk_bu
+@@ -2095,18 +2105,19 @@ static int ip_mkroute_input(struct sk_bu
*/
static int ip_route_input_slow(struct sk_buff *skb, __be32 daddr, __be32 saddr,
unsigned flags = 0;
u32 itag = 0;
struct rtable * rth;
-@@ -2165,6 +2176,12 @@ static int ip_route_input_slow(struct sk
+@@ -2142,6 +2153,12 @@ static int ip_route_input_slow(struct sk
ipv4_is_loopback(daddr))
goto martian_destination;
/*
* Now we are ready to route packet.
*/
-@@ -2174,6 +2191,8 @@ static int ip_route_input_slow(struct sk
+@@ -2151,6 +2168,8 @@ static int ip_route_input_slow(struct sk
goto no_route;
}
free_res = 1;
RT_CACHE_STAT_INC(in_slow_tot);
-@@ -2198,7 +2217,7 @@ static int ip_route_input_slow(struct sk
+@@ -2175,7 +2194,7 @@ static int ip_route_input_slow(struct sk
if (res.type != RTN_UNICAST)
goto martian_destination;
done:
in_dev_put(in_dev);
if (free_res)
-@@ -2208,6 +2227,8 @@ out: return err;
+@@ -2185,6 +2204,8 @@ out: return err;
brd_input:
if (skb->protocol != htons(ETH_P_IP))
goto e_inval;
if (ipv4_is_zeronet(saddr))
spec_dst = inet_select_addr(dev, 0, RT_SCOPE_LINK);
-@@ -2250,6 +2271,7 @@ local_input:
+@@ -2227,6 +2248,7 @@ local_input:
rth->u.dst.dev = net->loopback_dev;
dev_hold(rth->u.dst.dev);
rth->idev = in_dev_get(rth->u.dst.dev);
rth->rt_gateway = daddr;
rth->rt_spec_dst= spec_dst;
rth->u.dst.input= ip_local_deliver;
-@@ -2300,8 +2322,9 @@ martian_source:
+@@ -2277,8 +2299,9 @@ martian_source:
goto e_inval;
}
--int ip_route_input(struct sk_buff *skb, __be32 daddr, __be32 saddr,
-- u8 tos, struct net_device *dev)
-+static inline int
-+ip_route_input_cached(struct sk_buff *skb, __be32 daddr, __be32 saddr,
-+ u8 tos, struct net_device *dev, __be32 lsrc)
+-int ip_route_input_common(struct sk_buff *skb, __be32 daddr, __be32 saddr,
+- u8 tos, struct net_device *dev, bool noref)
++int ip_route_input_cached(struct sk_buff *skb, __be32 daddr, __be32 saddr,
++ u8 tos, struct net_device *dev, bool noref,
++ __be32 lsrc)
{
struct rtable * rth;
unsigned hash;
-@@ -2322,6 +2345,7 @@ int ip_route_input(struct sk_buff *skb,
- if (((rth->fl.fl4_dst ^ daddr) |
- (rth->fl.fl4_src ^ saddr) |
+@@ -2299,6 +2322,7 @@ int ip_route_input_common(struct sk_buff
+ if ((((__force u32)rth->fl.fl4_dst ^ (__force u32)daddr) |
+ ((__force u32)rth->fl.fl4_src ^ (__force u32)saddr) |
(rth->fl.iif ^ iif) |
+ (rth->fl.fl4_lsrc ^ lsrc) |
rth->fl.oif |
(rth->fl.fl4_tos ^ tos)) == 0 &&
rth->fl.mark == skb->mark &&
-@@ -2371,7 +2395,19 @@ skip_cache:
+@@ -2353,10 +2377,22 @@ skip_cache:
rcu_read_unlock();
return -EINVAL;
}
+ return ip_route_input_slow(skb, daddr, saddr, tos, dev, lsrc);
+}
+
-+int ip_route_input(struct sk_buff *skb, __be32 daddr, __be32 saddr,
-+ u8 tos, struct net_device *dev)
++int ip_route_input_common(struct sk_buff *skb, __be32 daddr, __be32 saddr,
++ u8 tos, struct net_device *dev, bool noref)
+{
-+ return ip_route_input_cached(skb, daddr, saddr, tos, dev, 0);
-+}
-+
++ return ip_route_input_cached(skb, daddr, saddr, tos, dev, noref, 0);
+ }
+ EXPORT_SYMBOL(ip_route_input_common);
+
+int ip_route_input_lookup(struct sk_buff *skb, __be32 daddr, __be32 saddr,
+ u8 tos, struct net_device *dev, __be32 lsrc)
+{
-+ return ip_route_input_cached(skb, daddr, saddr, tos, dev, lsrc);
- }
-
++ return ip_route_input_cached(skb, daddr, saddr, tos, dev, true, lsrc);
++}
++
static int __mkroute_output(struct rtable **result,
-@@ -2443,6 +2479,7 @@ static int __mkroute_output(struct rtabl
+ struct fib_result *res,
+ const struct flowi *fl,
+@@ -2426,6 +2462,7 @@ static int __mkroute_output(struct rtabl
rth->fl.fl4_tos = tos;
rth->fl.fl4_src = oldflp->fl4_src;
rth->fl.oif = oldflp->oif;
rth->fl.mark = oldflp->mark;
rth->rt_dst = fl->fl4_dst;
rth->rt_src = fl->fl4_src;
-@@ -2525,6 +2562,7 @@ static int ip_route_output_slow(struct n
+@@ -2508,6 +2545,7 @@ static int ip_route_output_slow(struct n
struct flowi fl = { .nl_u = { .ip4_u =
{ .daddr = oldflp->fl4_dst,
.saddr = oldflp->fl4_src,
.tos = tos & IPTOS_RT_MASK,
.scope = ((tos & RTO_ONLINK) ?
RT_SCOPE_LINK :
-@@ -2636,6 +2674,7 @@ static int ip_route_output_slow(struct n
+@@ -2619,6 +2657,7 @@ static int ip_route_output_slow(struct n
dev_out = net->loopback_dev;
dev_hold(dev_out);
fl.oif = net->loopback_dev->ifindex;
res.type = RTN_LOCAL;
flags |= RTCF_LOCAL;
goto make_route;
-@@ -2643,7 +2682,7 @@ static int ip_route_output_slow(struct n
+@@ -2626,7 +2665,7 @@ static int ip_route_output_slow(struct n
if (fib_lookup(net, &fl, &res)) {
res.fi = NULL;
/* Apparently, routing tables are wrong. Assume,
that the destination is on link.
-@@ -2683,6 +2722,7 @@ static int ip_route_output_slow(struct n
+@@ -2666,6 +2705,7 @@ static int ip_route_output_slow(struct n
dev_out = net->loopback_dev;
dev_hold(dev_out);
fl.oif = dev_out->ifindex;
if (res.fi)
fib_info_put(res.fi);
res.fi = NULL;
-@@ -2690,13 +2730,12 @@ static int ip_route_output_slow(struct n
+@@ -2673,13 +2713,12 @@ static int ip_route_output_slow(struct n
goto make_route;
}
if (!fl.fl4_src)
fl.fl4_src = FIB_RES_PREFSRC(res);
-@@ -2737,6 +2776,7 @@ int __ip_route_output_key(struct net *ne
+@@ -2720,6 +2759,7 @@ int __ip_route_output_key(struct net *ne
rth->fl.fl4_src == flp->fl4_src &&
rth->fl.iif == 0 &&
rth->fl.oif == flp->oif &&
rth->fl.mark == flp->mark &&
!((rth->fl.fl4_tos ^ flp->fl4_tos) &
(IPTOS_RT_MASK | RTO_ONLINK)) &&
-@@ -3456,3 +3496,4 @@ void __init ip_static_sysctl_init(void)
+@@ -3368,3 +3408,4 @@ void __init ip_static_sysctl_init(void)
+
EXPORT_SYMBOL(__ip_select_ident);
- EXPORT_SYMBOL(ip_route_input);
EXPORT_SYMBOL(ip_route_output_key);
+EXPORT_SYMBOL(ip_route_input_lookup);