aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/generic-2.4/patches/700-multiple_default_gateways.patch
diff options
context:
space:
mode:
Diffstat (limited to 'target/linux/generic-2.4/patches/700-multiple_default_gateways.patch')
-rw-r--r--target/linux/generic-2.4/patches/700-multiple_default_gateways.patch198
1 files changed, 99 insertions, 99 deletions
diff --git a/target/linux/generic-2.4/patches/700-multiple_default_gateways.patch b/target/linux/generic-2.4/patches/700-multiple_default_gateways.patch
index 7b4e48f720..7d5895e6f0 100644
--- a/target/linux/generic-2.4/patches/700-multiple_default_gateways.patch
+++ b/target/linux/generic-2.4/patches/700-multiple_default_gateways.patch
@@ -1,8 +1,8 @@
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);
@@ -18,9 +18,9 @@ Index: linux-2.4.35.4/include/linux/netfilter_ipv4/ip_nat.h
#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 */
@@ -31,9 +31,9 @@ Index: linux-2.4.35.4/include/linux/rtnetlink.h
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)
{
@@ -43,7 +43,7 @@ Index: linux-2.4.35.4/include/net/ip_fib.h
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);
@@ -51,7 +51,7 @@ Index: linux-2.4.35.4/include/net/ip_fib.h
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
}
@@ -60,9 +60,9 @@ Index: linux-2.4.35.4/include/net/ip_fib.h
#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;
@@ -71,7 +71,7 @@ Index: linux-2.4.35.4/include/net/route.h
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);
@@ -79,7 +79,7 @@ Index: linux-2.4.35.4/include/net/route.h
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
}
@@ -97,8 +97,8 @@ Index: linux-2.4.35.4/include/net/route.h
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;
@@ -108,7 +108,7 @@ Index: linux-2.4.35.4/net/ipv4/fib_frontend.c
#else
#define RT_TABLE_MIN 1
-@@ -71,6 +73,7 @@
+@@ -71,6 +73,7 @@ struct fib_table *__fib_new_table(int id
return tb;
}
@@ -116,7 +116,7 @@ Index: linux-2.4.35.4/net/ipv4/fib_frontend.c
#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;
@@ -126,7 +126,7 @@ Index: linux-2.4.35.4/net/ipv4/fib_frontend.c
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;
@@ -134,7 +134,7 @@ Index: linux-2.4.35.4/net/ipv4/fib_frontend.c
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);
@@ -177,7 +177,7 @@ Index: linux-2.4.35.4/net/ipv4/fib_frontend.c
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);
@@ -187,7 +187,7 @@ Index: linux-2.4.35.4/net/ipv4/fib_frontend.c
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);
@@ -199,9 +199,9 @@ Index: linux-2.4.35.4/net/ipv4/fib_frontend.c
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;
@@ -209,7 +209,7 @@ Index: linux-2.4.35.4/net/ipv4/fib_hash.c
u8 fn_tos;
u8 fn_type;
u8 fn_scope;
-@@ -336,72 +337,123 @@
+@@ -336,72 +337,123 @@ out:
return err;
}
@@ -364,7 +364,7 @@ Index: linux-2.4.35.4/net/ipv4/fib_hash.c
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) {
@@ -393,7 +393,7 @@ Index: linux-2.4.35.4/net/ipv4/fib_hash.c
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);
@@ -406,7 +406,7 @@ Index: linux-2.4.35.4/net/ipv4/fib_hash.c
out:
read_unlock(&fib_hash_lock);
}
-@@ -589,6 +653,7 @@
+@@ -589,6 +653,7 @@ replace:
memset(new_f, 0, sizeof(struct fib_node));
@@ -416,9 +416,9 @@ Index: linux-2.4.35.4/net/ipv4/fib_hash.c
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_
}
}
@@ -430,7 +430,7 @@ Index: linux-2.4.35.4/net/ipv4/fib_rules.c
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)
{
@@ -445,8 +445,8 @@ Index: linux-2.4.35.4/net/ipv4/fib_rules.c
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;
@@ -455,7 +455,7 @@ Index: linux-2.4.35.4/net/ipv4/fib_semantics.c
#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
@@ -464,7 +464,7 @@ Index: linux-2.4.35.4/net/ipv4/fib_semantics.c
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 &&
@@ -473,7 +473,7 @@ Index: linux-2.4.35.4/net/ipv4/fib_semantics.c
(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;
@@ -487,7 +487,7 @@ Index: linux-2.4.35.4/net/ipv4/fib_semantics.c
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;
@@ -552,7 +552,7 @@ Index: linux-2.4.35.4/net/ipv4/fib_semantics.c
} 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)) {
@@ -566,7 +566,7 @@ Index: linux-2.4.35.4/net/ipv4/fib_semantics.c
}
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;
@@ -581,7 +581,7 @@ Index: linux-2.4.35.4/net/ipv4/fib_semantics.c
}
#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++;
@@ -626,7 +626,7 @@ Index: linux-2.4.35.4/net/ipv4/fib_semantics.c
}
#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;
}
@@ -690,7 +690,7 @@ Index: linux-2.4.35.4/net/ipv4/fib_semantics.c
} 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();
@@ -704,7 +704,7 @@ Index: linux-2.4.35.4/net/ipv4/fib_semantics.c
/*
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;
@@ -758,7 +758,7 @@ Index: linux-2.4.35.4/net/ipv4/fib_semantics.c
}
-@@ -982,20 +1074,40 @@
+@@ -982,20 +1074,40 @@ void fib_select_multipath(const struct r
w = jiffies % fi->fib_power;
@@ -804,9 +804,9 @@ Index: linux-2.4.35.4/net/ipv4/fib_semantics.c
#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;
@@ -816,9 +816,9 @@ Index: linux-2.4.35.4/net/ipv4/ip_nat_dumb.c
#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;
@@ -829,7 +829,7 @@ Index: linux-2.4.35.4/net/ipv4/netfilter/ip_fw_compat_masq.c
/* 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;
@@ -862,7 +862,7 @@ Index: linux-2.4.35.4/net/ipv4/netfilter/ip_fw_compat_masq.c
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;
}
@@ -897,9 +897,9 @@ Index: linux-2.4.35.4/net/ipv4/netfilter/ip_fw_compat_masq.c
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;
}
@@ -962,9 +962,9 @@ Index: linux-2.4.35.4/net/ipv4/netfilter/ip_nat_core.c
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 };
@@ -974,7 +974,7 @@ Index: linux-2.4.35.4/net/ipv4/netfilter/ip_nat_standalone.c
/* 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;
}
@@ -991,7 +991,7 @@ Index: linux-2.4.35.4/net/ipv4/netfilter/ip_nat_standalone.c
}
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);
@@ -1002,9 +1002,9 @@ Index: linux-2.4.35.4/net/ipv4/netfilter/ip_nat_standalone.c
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;
@@ -1014,7 +1014,7 @@ Index: linux-2.4.35.4/net/ipv4/netfilter/ipt_MASQUERADE.c
#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;
}
@@ -1030,9 +1030,9 @@ Index: linux-2.4.35.4/net/ipv4/netfilter/ipt_MASQUERADE.c
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;
@@ -1040,7 +1040,7 @@ Index: linux-2.4.35.4/net/ipv4/route.c
/* 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;
@@ -1048,7 +1048,7 @@ Index: linux-2.4.35.4/net/ipv4/route.c
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;
@@ -1056,7 +1056,7 @@ Index: linux-2.4.35.4/net/ipv4/route.c
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,
@@ -1065,7 +1065,7 @@ Index: linux-2.4.35.4/net/ipv4/route.c
{
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;
@@ -1086,7 +1086,7 @@ Index: linux-2.4.35.4/net/ipv4/route.c
/* 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;
@@ -1099,7 +1099,7 @@ Index: linux-2.4.35.4/net/ipv4/route.c
/*
* 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;
@@ -1110,7 +1110,7 @@ Index: linux-2.4.35.4/net/ipv4/route.c
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;
@@ -1119,7 +1119,7 @@ Index: linux-2.4.35.4/net/ipv4/route.c
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;
@@ -1130,7 +1130,7 @@ Index: linux-2.4.35.4/net/ipv4/route.c
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)) &&
@@ -1138,7 +1138,7 @@ Index: linux-2.4.35.4/net/ipv4/route.c
(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;
@@ -1146,7 +1146,7 @@ Index: linux-2.4.35.4/net/ipv4/route.c
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;
@@ -1154,7 +1154,7 @@ Index: linux-2.4.35.4/net/ipv4/route.c
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
@@ -1164,7 +1164,7 @@ Index: linux-2.4.35.4/net/ipv4/route.c
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;
@@ -1173,7 +1173,7 @@ Index: linux-2.4.35.4/net/ipv4/route.c
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;
@@ -1181,7 +1181,7 @@ Index: linux-2.4.35.4/net/ipv4/route.c
#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;
@@ -1189,7 +1189,7 @@ Index: linux-2.4.35.4/net/ipv4/route.c
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;
}
@@ -1201,7 +1201,7 @@ Index: linux-2.4.35.4/net/ipv4/route.c
{
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 &&
@@ -1209,7 +1209,7 @@ Index: linux-2.4.35.4/net/ipv4/route.c
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;
}
@@ -1232,7 +1232,7 @@ Index: linux-2.4.35.4/net/ipv4/route.c
/*
* 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;
@@ -1240,7 +1240,7 @@ Index: linux-2.4.35.4/net/ipv4/route.c
#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;
@@ -1248,7 +1248,7 @@ Index: linux-2.4.35.4/net/ipv4/route.c
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;
@@ -1257,7 +1257,7 @@ Index: linux-2.4.35.4/net/ipv4/route.c
/* 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;
@@ -1265,7 +1265,7 @@ Index: linux-2.4.35.4/net/ipv4/route.c
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;
}
@@ -1282,7 +1282,7 @@ Index: linux-2.4.35.4/net/ipv4/route.c
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;
@@ -1292,7 +1292,7 @@ Index: linux-2.4.35.4/net/ipv4/route.c
#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 &&
@@ -1302,9 +1302,9 @@ Index: linux-2.4.35.4/net/ipv4/route.c
#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);