Index: linux-2.4.35.4/include/linux/netfilter_ipv4/ip_nat.h
===================================================================
---- linux-2.4.35.4.orig/include/linux/netfilter_ipv4/ip_nat.h 2007-12-15 05:19:36.574505299 +0100
-+++ linux-2.4.35.4/include/linux/netfilter_ipv4/ip_nat.h 2007-12-15 05:20:13.092586349 +0100
-@@ -121,5 +121,13 @@
+--- linux-2.4.35.4.orig/include/linux/netfilter_ipv4/ip_nat.h
++++ linux-2.4.35.4/include/linux/netfilter_ipv4/ip_nat.h
+@@ -121,5 +121,13 @@ extern int ip_nat_used_tuple(const struc
extern u_int16_t ip_nat_cheat_check(u_int32_t oldvalinv,
u_int32_t newval,
u_int16_t oldcheck);
#endif
Index: linux-2.4.35.4/include/linux/rtnetlink.h
===================================================================
---- linux-2.4.35.4.orig/include/linux/rtnetlink.h 2007-12-15 05:19:36.582505757 +0100
-+++ linux-2.4.35.4/include/linux/rtnetlink.h 2007-12-15 05:20:13.092586349 +0100
-@@ -234,6 +234,8 @@
+--- linux-2.4.35.4.orig/include/linux/rtnetlink.h
++++ linux-2.4.35.4/include/linux/rtnetlink.h
+@@ -234,6 +234,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 */
Index: linux-2.4.35.4/include/net/ip_fib.h
===================================================================
---- linux-2.4.35.4.orig/include/net/ip_fib.h 2007-12-15 05:19:36.590506213 +0100
-+++ linux-2.4.35.4/include/net/ip_fib.h 2007-12-15 05:20:13.100586801 +0100
-@@ -162,7 +162,8 @@
+--- linux-2.4.35.4.orig/include/net/ip_fib.h
++++ linux-2.4.35.4/include/net/ip_fib.h
+@@ -162,7 +162,8 @@ static inline int fib_lookup(const struc
static inline void fib_select_default(const struct rt_key *key, struct fib_result *res)
{
main_table->tb_select_default(main_table, key, res);
}
-@@ -174,6 +175,7 @@
+@@ -174,6 +175,7 @@ extern struct fib_table * fib_tables[RT_
extern int fib_lookup(const struct rt_key *key, struct fib_result *res);
extern struct fib_table *__fib_new_table(int id);
extern void fib_rule_put(struct fib_rule *r);
static inline struct fib_table *fib_get_table(int id)
{
-@@ -275,5 +277,6 @@
+@@ -275,5 +277,6 @@ static inline void fib_res_put(struct fi
#endif
}
#endif /* _NET_FIB_H */
Index: linux-2.4.35.4/include/net/route.h
===================================================================
---- linux-2.4.35.4.orig/include/net/route.h 2007-12-15 05:19:36.598506668 +0100
-+++ linux-2.4.35.4/include/net/route.h 2007-12-15 05:20:13.104587030 +0100
-@@ -49,6 +49,8 @@
+--- linux-2.4.35.4.orig/include/net/route.h
++++ linux-2.4.35.4/include/net/route.h
+@@ -49,6 +49,8 @@ struct rt_key
{
__u32 dst;
__u32 src;
int iif;
int oif;
#ifdef CONFIG_IP_ROUTE_FWMARK
-@@ -128,6 +130,7 @@
+@@ -128,6 +130,7 @@ extern void ip_rt_advice(struct rtable
extern void rt_cache_flush(int how);
extern int ip_route_output_key(struct rtable **, const struct rt_key *key);
extern int ip_route_input(struct sk_buff*, u32 dst, u32 src, u8 tos, struct net_device *devin);
extern unsigned short ip_rt_frag_needed(struct iphdr *iph, unsigned short new_mtu);
extern void ip_rt_update_pmtu(struct dst_entry *dst, unsigned mtu);
extern void ip_rt_send_redirect(struct sk_buff *skb);
-@@ -148,6 +151,15 @@
+@@ -148,6 +151,15 @@ static inline int ip_route_output(struct
}
if (rt)
Index: linux-2.4.35.4/net/ipv4/fib_frontend.c
===================================================================
---- linux-2.4.35.4.orig/net/ipv4/fib_frontend.c 2007-12-15 05:19:36.606507123 +0100
-+++ linux-2.4.35.4/net/ipv4/fib_frontend.c 2007-12-15 05:20:13.108587259 +0100
+--- linux-2.4.35.4.orig/net/ipv4/fib_frontend.c
++++ linux-2.4.35.4/net/ipv4/fib_frontend.c
@@ -54,6 +54,8 @@
struct fib_table *local_table;
struct fib_table *main_table;
#else
#define RT_TABLE_MIN 1
-@@ -71,6 +73,7 @@
+@@ -71,6 +73,7 @@ struct fib_table *__fib_new_table(int id
return tb;
}
#endif /* CONFIG_IP_MULTIPLE_TABLES */
-@@ -209,6 +212,9 @@
+@@ -209,6 +212,9 @@ int fib_validate_source(u32 src, u32 dst
struct in_device *in_dev;
struct rt_key key;
struct fib_result res;
int no_addr, rpf;
int ret;
-@@ -216,6 +222,7 @@
+@@ -216,6 +222,7 @@ int fib_validate_source(u32 src, u32 dst
key.src = dst;
key.tos = tos;
key.oif = 0;
key.iif = oif;
key.scope = RT_SCOPE_UNIVERSE;
-@@ -237,31 +244,35 @@
+@@ -237,31 +244,35 @@ int fib_validate_source(u32 src, u32 dst
goto e_inval_res;
*spec_dst = FIB_RES_PREFSRC(res);
fib_combine_itag(itag, &res);
return ret;
last_resort:
-@@ -579,9 +590,7 @@
+@@ -579,9 +590,7 @@ static int fib_inetaddr_event(struct not
switch (event) {
case NETDEV_UP:
fib_add_ifaddr(ifa);
rt_cache_flush(-1);
break;
case NETDEV_DOWN:
-@@ -617,9 +626,7 @@
+@@ -617,9 +626,7 @@ static int fib_netdev_event(struct notif
for_ifa(in_dev) {
fib_add_ifaddr(ifa);
} endfor_ifa(in_dev);
case NETDEV_DOWN:
Index: linux-2.4.35.4/net/ipv4/fib_hash.c
===================================================================
---- linux-2.4.35.4.orig/net/ipv4/fib_hash.c 2007-12-15 05:19:36.614507579 +0100
-+++ linux-2.4.35.4/net/ipv4/fib_hash.c 2007-12-15 05:20:13.108587259 +0100
-@@ -71,6 +71,7 @@
+--- linux-2.4.35.4.orig/net/ipv4/fib_hash.c
++++ linux-2.4.35.4/net/ipv4/fib_hash.c
+@@ -71,6 +71,7 @@ struct fib_node
struct fib_info *fn_info;
#define FIB_INFO(f) ((f)->fn_info)
fn_key_t fn_key;
u8 fn_tos;
u8 fn_type;
u8 fn_scope;
-@@ -336,72 +337,123 @@
+@@ -336,72 +337,123 @@ out:
return err;
}
goto out;
}
fi = next_fi;
-@@ -409,16 +461,25 @@
+@@ -409,16 +461,25 @@ fn_hash_select_default(struct fib_table
}
if (order<=0 || fi==NULL) {
goto out;
}
-@@ -428,8 +489,11 @@
+@@ -428,8 +489,11 @@ fn_hash_select_default(struct fib_table
res->fi = last_resort;
if (last_resort)
atomic_inc(&last_resort->fib_clntref);
out:
read_unlock(&fib_hash_lock);
}
-@@ -589,6 +653,7 @@
+@@ -589,6 +653,7 @@ replace:
memset(new_f, 0, sizeof(struct fib_node));
new_f->fn_tos = tos;
Index: linux-2.4.35.4/net/ipv4/fib_rules.c
===================================================================
---- linux-2.4.35.4.orig/net/ipv4/fib_rules.c 2007-12-15 05:19:36.618507808 +0100
-+++ linux-2.4.35.4/net/ipv4/fib_rules.c 2007-12-15 05:20:13.108587259 +0100
-@@ -307,6 +307,11 @@
+--- linux-2.4.35.4.orig/net/ipv4/fib_rules.c
++++ linux-2.4.35.4/net/ipv4/fib_rules.c
+@@ -307,6 +307,11 @@ static void fib_rules_attach(struct net_
}
}
int fib_lookup(const struct rt_key *key, struct fib_result *res)
{
int err;
-@@ -371,8 +376,10 @@
+@@ -371,8 +376,10 @@ FRprintk("FAILURE\n");
void fib_select_default(const struct rt_key *key, struct fib_result *res)
{
tb->tb_select_default(tb, key, res);
Index: linux-2.4.35.4/net/ipv4/fib_semantics.c
===================================================================
---- linux-2.4.35.4.orig/net/ipv4/fib_semantics.c 2007-12-15 05:19:36.626508263 +0100
-+++ linux-2.4.35.4/net/ipv4/fib_semantics.c 2007-12-15 05:20:13.112587489 +0100
+--- linux-2.4.35.4.orig/net/ipv4/fib_semantics.c
++++ linux-2.4.35.4/net/ipv4/fib_semantics.c
@@ -48,6 +48,7 @@
static struct fib_info *fib_info_list;
static rwlock_t fib_info_lock = RW_LOCK_UNLOCKED;
#define for_fib_info() { struct fib_info *fi; \
for (fi = fib_info_list; fi; fi = fi->fib_next)
-@@ -150,7 +151,7 @@
+@@ -150,7 +151,7 @@ static __inline__ int nh_comp(const stru
#ifdef CONFIG_NET_CLS_ROUTE
nh->nh_tclassid != onh->nh_tclassid ||
#endif
return -1;
onh++;
} endfor_nexthops(fi);
-@@ -166,7 +167,7 @@
+@@ -166,7 +167,7 @@ static __inline__ struct fib_info * fib_
nfi->fib_prefsrc == fi->fib_prefsrc &&
nfi->fib_priority == fi->fib_priority &&
memcmp(nfi->fib_metrics, fi->fib_metrics, sizeof(fi->fib_metrics)) == 0 &&
(nfi->fib_nhs == 0 || nh_comp(fi, nfi) == 0))
return fi;
} endfor_fib_info();
-@@ -365,8 +366,11 @@
+@@ -365,8 +366,11 @@ static int fib_check_nh(const struct rtm
return -EINVAL;
if ((dev = __dev_get_by_index(nh->nh_oif)) == NULL)
return -ENODEV;
nh->nh_dev = dev;
dev_hold(dev);
nh->nh_scope = RT_SCOPE_LINK;
-@@ -380,23 +384,48 @@
+@@ -380,23 +384,48 @@ static int fib_check_nh(const struct rtm
/* It is not necessary, but requires a bit of thinking */
if (key.scope < RT_SCOPE_LINK)
key.scope = RT_SCOPE_LINK;
} else {
struct in_device *in_dev;
-@@ -407,8 +436,11 @@
+@@ -407,8 +436,11 @@ out:
if (in_dev == NULL)
return -ENODEV;
if (!(in_dev->dev->flags&IFF_UP)) {
}
nh->nh_dev = in_dev->dev;
dev_hold(nh->nh_dev);
-@@ -606,8 +638,12 @@
+@@ -606,8 +638,12 @@ fib_semantic_match(int type, struct fib_
for_nexthops(fi) {
if (nh->nh_flags&RTNH_F_DEAD)
continue;
}
#ifdef CONFIG_IP_ROUTE_MULTIPATH
if (nhsel < fi->fib_nhs) {
-@@ -873,22 +909,35 @@
+@@ -873,22 +909,35 @@ int fib_sync_down(u32 local, struct net_
if (local && fi->fib_prefsrc == local) {
fi->fib_flags |= RTNH_F_DEAD;
ret++;
}
#ifdef CONFIG_IP_ROUTE_MULTIPATH
if (force > 1 && nh->nh_dev == dev) {
-@@ -906,37 +955,55 @@
+@@ -906,37 +955,55 @@ int fib_sync_down(u32 local, struct net_
return ret;
}
} endfor_nexthops(fi)
if (alive > 0) {
-@@ -944,9 +1011,13 @@
+@@ -944,9 +1011,13 @@ int fib_sync_up(struct net_device *dev)
ret++;
}
} endfor_fib_info();
/*
The algorithm is suboptimal, but it provides really
fair weighted route distribution.
-@@ -955,24 +1026,45 @@
+@@ -955,24 +1026,45 @@ int fib_sync_up(struct net_device *dev)
void fib_select_multipath(const struct rt_key *key, struct fib_result *res)
{
struct fib_info *fi = res->fi;
}
-@@ -982,20 +1074,40 @@
+@@ -982,20 +1074,40 @@ void fib_select_multipath(const struct r
w = jiffies % fi->fib_power;
#endif
Index: linux-2.4.35.4/net/ipv4/ip_nat_dumb.c
===================================================================
---- linux-2.4.35.4.orig/net/ipv4/ip_nat_dumb.c 2007-12-15 05:19:36.634508719 +0100
-+++ linux-2.4.35.4/net/ipv4/ip_nat_dumb.c 2007-12-15 05:20:13.112587489 +0100
-@@ -124,6 +124,7 @@
+--- linux-2.4.35.4.orig/net/ipv4/ip_nat_dumb.c
++++ linux-2.4.35.4/net/ipv4/ip_nat_dumb.c
+@@ -124,6 +124,7 @@ ip_do_nat(struct sk_buff *skb)
key.dst = ciph->saddr;
key.iif = skb->dev->ifindex;
key.oif = 0;
#endif
Index: linux-2.4.35.4/net/ipv4/netfilter/ip_fw_compat_masq.c
===================================================================
---- linux-2.4.35.4.orig/net/ipv4/netfilter/ip_fw_compat_masq.c 2007-12-15 05:19:36.642509177 +0100
-+++ linux-2.4.35.4/net/ipv4/netfilter/ip_fw_compat_masq.c 2007-12-15 05:20:13.112587489 +0100
-@@ -41,6 +41,10 @@
+--- linux-2.4.35.4.orig/net/ipv4/netfilter/ip_fw_compat_masq.c
++++ linux-2.4.35.4/net/ipv4/netfilter/ip_fw_compat_masq.c
+@@ -41,6 +41,10 @@ do_masquerade(struct sk_buff **pskb, con
enum ip_conntrack_info ctinfo;
struct ip_conntrack *ct;
unsigned int ret;
/* Sorry, only ICMP, TCP and UDP. */
if (iph->protocol != IPPROTO_ICMP
-@@ -64,22 +68,28 @@
+@@ -64,22 +68,28 @@ do_masquerade(struct sk_buff **pskb, con
}
info = &ct->nat.info;
ip_rt_put(rt);
range = ((struct ip_nat_multi_range)
{ 1,
-@@ -92,11 +102,31 @@
+@@ -92,11 +102,31 @@ do_masquerade(struct sk_buff **pskb, con
WRITE_UNLOCK(&ip_nat_lock);
return ret;
}
void
Index: linux-2.4.35.4/net/ipv4/netfilter/ip_nat_core.c
===================================================================
---- linux-2.4.35.4.orig/net/ipv4/netfilter/ip_nat_core.c 2007-12-15 05:20:06.404205198 +0100
-+++ linux-2.4.35.4/net/ipv4/netfilter/ip_nat_core.c 2007-12-15 05:20:13.112587489 +0100
-@@ -994,6 +994,60 @@
+--- linux-2.4.35.4.orig/net/ipv4/netfilter/ip_nat_core.c
++++ linux-2.4.35.4/net/ipv4/netfilter/ip_nat_core.c
+@@ -994,6 +994,60 @@ icmp_reply_translation(struct sk_buff *s
return NF_ACCEPT;
}
size_t i;
Index: linux-2.4.35.4/net/ipv4/netfilter/ip_nat_standalone.c
===================================================================
---- linux-2.4.35.4.orig/net/ipv4/netfilter/ip_nat_standalone.c 2007-12-15 05:19:36.654509858 +0100
-+++ linux-2.4.35.4/net/ipv4/netfilter/ip_nat_standalone.c 2007-12-15 05:20:13.112587489 +0100
-@@ -245,6 +245,9 @@
+--- linux-2.4.35.4.orig/net/ipv4/netfilter/ip_nat_standalone.c
++++ linux-2.4.35.4/net/ipv4/netfilter/ip_nat_standalone.c
+@@ -245,6 +245,9 @@ ip_nat_local_fn(unsigned int hooknum,
/* Before packet filtering, change destination */
static struct nf_hook_ops ip_nat_in_ops
= { { NULL, NULL }, ip_nat_in, PF_INET, NF_IP_PRE_ROUTING, NF_IP_PRI_NAT_DST };
/* After packet filtering, change source */
static struct nf_hook_ops ip_nat_out_ops
= { { NULL, NULL }, ip_nat_out, PF_INET, NF_IP_POST_ROUTING, NF_IP_PRI_NAT_SRC};
-@@ -313,10 +316,15 @@
+@@ -313,10 +316,15 @@ static int init_or_cleanup(int init)
printk("ip_nat_init: can't register in hook.\n");
goto cleanup_nat;
}
}
ret = nf_register_hook(&ip_nat_local_out_ops);
if (ret < 0) {
-@@ -336,6 +344,8 @@
+@@ -336,6 +344,8 @@ static int init_or_cleanup(int init)
nf_unregister_hook(&ip_nat_local_out_ops);
cleanup_outops:
nf_unregister_hook(&ip_nat_out_ops);
cleanup_nat:
Index: linux-2.4.35.4/net/ipv4/netfilter/ipt_MASQUERADE.c
===================================================================
---- linux-2.4.35.4.orig/net/ipv4/netfilter/ipt_MASQUERADE.c 2007-12-15 05:19:36.662510316 +0100
-+++ linux-2.4.35.4/net/ipv4/netfilter/ipt_MASQUERADE.c 2007-12-15 05:20:13.116587715 +0100
-@@ -87,7 +87,8 @@
+--- linux-2.4.35.4.orig/net/ipv4/netfilter/ipt_MASQUERADE.c
++++ linux-2.4.35.4/net/ipv4/netfilter/ipt_MASQUERADE.c
+@@ -87,7 +87,8 @@ masquerade_target(struct sk_buff **pskb,
key.dst = (*pskb)->nh.iph->daddr;
key.src = 0; /* Unknown: that's what we're trying to establish */
key.tos = RT_TOS((*pskb)->nh.iph->tos)|RTO_CONN;
#ifdef CONFIG_IP_ROUTE_FWMARK
key.fwmark = (*pskb)->nfmark;
#endif
-@@ -98,13 +99,6 @@
+@@ -98,13 +99,6 @@ masquerade_target(struct sk_buff **pskb,
" No route: Rusty's brain broke!\n");
return NF_DROP;
}
DEBUGP("newsrc = %u.%u.%u.%u\n", NIPQUAD(newsrc));
Index: linux-2.4.35.4/net/ipv4/route.c
===================================================================
---- linux-2.4.35.4.orig/net/ipv4/route.c 2007-12-15 05:19:36.670510772 +0100
-+++ linux-2.4.35.4/net/ipv4/route.c 2007-12-15 05:20:13.116587715 +0100
-@@ -919,6 +919,7 @@
+--- linux-2.4.35.4.orig/net/ipv4/route.c
++++ linux-2.4.35.4/net/ipv4/route.c
+@@ -919,6 +919,7 @@ void ip_rt_redirect(u32 old_gw, u32 dadd
/* Gateway is different ... */
rt->rt_gateway = new_gw;
/* Redirect received -> path was valid */
dst_confirm(&rth->u.dst);
-@@ -1343,6 +1344,7 @@
+@@ -1343,6 +1344,7 @@ static int ip_route_input_mc(struct sk_b
rth->key.fwmark = skb->nfmark;
#endif
rth->key.src = saddr;
rth->rt_src = saddr;
#ifdef CONFIG_IP_ROUTE_NAT
rth->rt_dst_map = daddr;
-@@ -1356,6 +1358,7 @@
+@@ -1356,6 +1358,7 @@ static int ip_route_input_mc(struct sk_b
rth->u.dst.dev = &loopback_dev;
dev_hold(rth->u.dst.dev);
rth->key.oif = 0;
rth->rt_gateway = daddr;
rth->rt_spec_dst= spec_dst;
rth->rt_type = RTN_MULTICAST;
-@@ -1395,7 +1398,7 @@
+@@ -1395,7 +1398,7 @@ e_inval:
*/
int ip_route_input_slow(struct sk_buff *skb, u32 daddr, u32 saddr,
{
struct rt_key key;
struct fib_result res;
-@@ -1415,16 +1418,17 @@
+@@ -1415,16 +1418,17 @@ int ip_route_input_slow(struct sk_buff *
goto out;
key.dst = daddr;
/* Check for the most weird martians, which can be not detected
by fib_lookup.
-@@ -1445,6 +1449,12 @@
+@@ -1445,6 +1449,12 @@ int ip_route_input_slow(struct sk_buff *
if (BADCLASS(daddr) || ZERONET(daddr) || LOOPBACK(daddr))
goto martian_destination;
/*
* Now we are ready to route packet.
*/
-@@ -1454,6 +1464,10 @@
+@@ -1454,6 +1464,10 @@ int ip_route_input_slow(struct sk_buff *
goto no_route;
}
free_res = 1;
rt_cache_stat[smp_processor_id()].in_slow_tot++;
-@@ -1464,7 +1478,7 @@
+@@ -1464,7 +1478,7 @@ int ip_route_input_slow(struct sk_buff *
if (1) {
u32 src_map = saddr;
src_map = fib_rules_policy(saddr, &res, &flags);
if (res.type == RTN_NAT) {
-@@ -1503,8 +1517,9 @@
+@@ -1503,8 +1517,9 @@ int ip_route_input_slow(struct sk_buff *
if (res.type != RTN_UNICAST)
goto martian_destination;
fib_select_multipath(&key, &res);
#endif
out_dev = in_dev_get(FIB_RES_DEV(res));
-@@ -1524,6 +1539,7 @@
+@@ -1524,6 +1539,7 @@ int ip_route_input_slow(struct sk_buff *
flags |= RTCF_DIRECTSRC;
if (out_dev == in_dev && err && !(flags & (RTCF_NAT | RTCF_MASQ)) &&
(IN_DEV_SHARED_MEDIA(out_dev) ||
inet_addr_onlink(out_dev, saddr, FIB_RES_GW(res))))
flags |= RTCF_DOREDIRECT;
-@@ -1550,6 +1566,7 @@
+@@ -1550,6 +1566,7 @@ int ip_route_input_slow(struct sk_buff *
#endif
rth->key.src = saddr;
rth->rt_src = saddr;
rth->rt_gateway = daddr;
#ifdef CONFIG_IP_ROUTE_NAT
rth->rt_src_map = key.src;
-@@ -1562,6 +1579,7 @@
+@@ -1562,6 +1579,7 @@ int ip_route_input_slow(struct sk_buff *
rth->u.dst.dev = out_dev->dev;
dev_hold(rth->u.dst.dev);
rth->key.oif = 0;
rth->rt_spec_dst= spec_dst;
rth->u.dst.input = ip_forward;
-@@ -1572,7 +1590,8 @@
+@@ -1572,7 +1590,8 @@ int ip_route_input_slow(struct sk_buff *
rth->rt_flags = flags;
#ifdef CONFIG_NET_FASTROUTE
struct net_device *odev = rth->u.dst.dev;
if (odev != dev &&
dev->accept_fastpath &&
-@@ -1595,6 +1614,8 @@
+@@ -1595,6 +1614,8 @@ out: return err;
brd_input:
if (skb->protocol != htons(ETH_P_IP))
goto e_inval;
if (ZERONET(saddr))
spec_dst = inet_select_addr(dev, 0, RT_SCOPE_LINK);
-@@ -1627,6 +1648,7 @@
+@@ -1627,6 +1648,7 @@ local_input:
#endif
rth->key.src = saddr;
rth->rt_src = saddr;
#ifdef CONFIG_IP_ROUTE_NAT
rth->rt_dst_map = key.dst;
rth->rt_src_map = key.src;
-@@ -1639,6 +1661,7 @@
+@@ -1639,6 +1661,7 @@ local_input:
rth->u.dst.dev = &loopback_dev;
dev_hold(rth->u.dst.dev);
rth->key.oif = 0;
rth->rt_gateway = daddr;
rth->rt_spec_dst= spec_dst;
rth->u.dst.input= ip_local_deliver;
-@@ -1704,8 +1727,9 @@
+@@ -1704,8 +1727,9 @@ martian_source:
goto e_inval;
}
{
struct rtable * rth;
unsigned hash;
-@@ -1719,6 +1743,7 @@
+@@ -1719,6 +1743,7 @@ int ip_route_input(struct sk_buff *skb,
if (rth->key.dst == daddr &&
rth->key.src == saddr &&
rth->key.iif == iif &&
rth->key.oif == 0 &&
#ifdef CONFIG_IP_ROUTE_FWMARK
rth->key.fwmark == skb->nfmark &&
-@@ -1766,9 +1791,21 @@
+@@ -1766,9 +1791,21 @@ int ip_route_input(struct sk_buff *skb,
read_unlock(&inetdev_lock);
return -EINVAL;
}
/*
* Major route resolver routine.
*/
-@@ -1791,6 +1828,7 @@
+@@ -1791,6 +1828,7 @@ int ip_route_output_slow(struct rtable *
key.tos = tos & IPTOS_RT_MASK;
key.iif = loopback_dev.ifindex;
key.oif = oldkey->oif;
#ifdef CONFIG_IP_ROUTE_FWMARK
key.fwmark = oldkey->fwmark;
#endif
-@@ -1880,6 +1918,7 @@
+@@ -1880,6 +1918,7 @@ int ip_route_output_slow(struct rtable *
dev_out = &loopback_dev;
dev_hold(dev_out);
key.oif = loopback_dev.ifindex;
res.type = RTN_LOCAL;
flags |= RTCF_LOCAL;
goto make_route;
-@@ -1887,7 +1926,7 @@
+@@ -1887,7 +1926,7 @@ int ip_route_output_slow(struct rtable *
if (fib_lookup(&key, &res)) {
res.fi = NULL;
/* Apparently, routing tables are wrong. Assume,
that the destination is on link.
-@@ -1930,6 +1969,7 @@
+@@ -1930,6 +1969,7 @@ int ip_route_output_slow(struct rtable *
dev_out = &loopback_dev;
dev_hold(dev_out);
key.oif = dev_out->ifindex;
if (res.fi)
fib_info_put(res.fi);
res.fi = NULL;
-@@ -1937,13 +1977,12 @@
+@@ -1937,13 +1977,12 @@ int ip_route_output_slow(struct rtable *
goto make_route;
}
if (!key.src)
key.src = FIB_RES_PREFSRC(res);
-@@ -2001,7 +2040,9 @@
+@@ -2001,7 +2040,9 @@ make_route:
rth->key.tos = tos;
rth->key.src = oldkey->src;
rth->key.iif = 0;
#ifdef CONFIG_IP_ROUTE_FWMARK
rth->key.fwmark = oldkey->fwmark;
#endif
-@@ -2080,6 +2121,7 @@
+@@ -2080,6 +2121,7 @@ int ip_route_output_key(struct rtable **
rth->key.src == key->src &&
rth->key.iif == 0 &&
rth->key.oif == key->oif &&
#endif
Index: linux-2.4.35.4/net/netsyms.c
===================================================================
---- linux-2.4.35.4.orig/net/netsyms.c 2007-12-15 05:19:36.678511227 +0100
-+++ linux-2.4.35.4/net/netsyms.c 2007-12-15 05:20:13.120587941 +0100
-@@ -260,6 +260,7 @@
+--- linux-2.4.35.4.orig/net/netsyms.c
++++ linux-2.4.35.4/net/netsyms.c
+@@ -260,6 +260,7 @@ EXPORT_SYMBOL(inet_register_protosw);
EXPORT_SYMBOL(inet_unregister_protosw);
EXPORT_SYMBOL(ip_route_output_key);
EXPORT_SYMBOL(ip_route_input);