X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=net%2Fipv4%2Ffib_rules.c;h=ee19a7e7a881653a484e3b613bcfec8b5886dadf;hb=c7b5ebbddf7bcd3651947760f423e3783bbe6573;hp=66e78bb4e2d4ea8d615561ab9e3c89f59722eaaa;hpb=a2c21200f1c81b08cb55e417b68150bba439b646;p=linux-2.6.git diff --git a/net/ipv4/fib_rules.c b/net/ipv4/fib_rules.c index 66e78bb4e..ee19a7e7a 100644 --- a/net/ipv4/fib_rules.c +++ b/net/ipv4/fib_rules.c @@ -176,7 +176,7 @@ int inet_rtm_newrule(struct sk_buff *skb, struct nlmsghdr* nlh, void *arg) table_id = rtm->rtm_table; if (table_id == RT_TABLE_UNSPEC) { struct fib_table *table; - if (rtm->rtm_type == RTN_UNICAST || rtm->rtm_type == RTN_NAT) { + if (rtm->rtm_type == RTN_UNICAST) { if ((table = fib_empty_table()) == NULL) return -ENOBUFS; table_id = table->tb_id; @@ -251,26 +251,6 @@ u32 fib_rules_map_destination(u32 daddr, struct fib_result *res) return (daddr&~mask)|res->fi->fib_nh->nh_gw; } -u32 fib_rules_policy(u32 saddr, struct fib_result *res, unsigned *flags) -{ - struct fib_rule *r = res->r; - - if (r->r_action == RTN_NAT) { - int addrtype = inet_addr_type(r->r_srcmap); - - if (addrtype == RTN_NAT) { - /* Packet is from translated source; remember it */ - saddr = (saddr&~r->r_srcmask)|r->r_srcmap; - *flags |= RTCF_SNAT; - } else if (addrtype == RTN_LOCAL || r->r_srcmap == 0) { - /* Packet is from masqueraded source; remember it */ - saddr = r->r_srcmap; - *flags |= RTCF_MASQ; - } - } - return saddr; -} - #ifdef CONFIG_NET_CLS_ROUTE u32 fib_rules_tclass(struct fib_result *res) { @@ -322,9 +302,7 @@ FRprintk("Lookup: %u.%u.%u.%u <- %u.%u.%u.%u ", for (r = fib_rules; r; r=r->r_next) { if (((saddr^r->r_src) & r->r_srcmask) || ((daddr^r->r_dst) & r->r_dstmask) || -#ifdef CONFIG_IP_ROUTE_TOS (r->r_tos && r->r_tos != flp->fl4_tos) || -#endif #ifdef CONFIG_IP_ROUTE_FWMARK (r->r_fwmark && r->r_fwmark != flp->fl4_fwmark) || #endif @@ -334,7 +312,6 @@ FRprintk("Lookup: %u.%u.%u.%u <- %u.%u.%u.%u ", FRprintk("tb %d r %d ", r->r_table, r->r_action); switch (r->r_action) { case RTN_UNICAST: - case RTN_NAT: policy = r; break; case RTN_UNREACHABLE: