diff options
author | Rami Rosen <ramirose@gmail.com> | 2008-01-09 03:18:24 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-01-28 18:01:07 -0500 |
commit | cb7928a528264a69b29b6001b490b64607ed0557 (patch) | |
tree | 250a296f668275eb628e6dd1f83c221f0afae422 | |
parent | f0b5a0dcf125ce43855961ef4f965a91112bea23 (diff) |
[IPV4]: Remove unsupported DNAT (RTCF_NAT and RTCF_NAT) in IPV4
- The DNAT (Destination NAT) is not implemented in IPV4.
- This patch remove the code which checks these flags
in net/ipv4/arp.c and net/ipv4/route.c.
The RTCF_NAT and RTCF_NAT should stay in the header (linux/in_route.h)
because they are used in DECnet.
Signed-off-by: Rami Rosen <ramirose@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | net/ipv4/arp.c | 5 | ||||
-rw-r--r-- | net/ipv4/route.c | 4 |
2 files changed, 4 insertions, 5 deletions
diff --git a/net/ipv4/arp.c b/net/ipv4/arp.c index 9eb6d3ab2977..46edf1c32a40 100644 --- a/net/ipv4/arp.c +++ b/net/ipv4/arp.c | |||
@@ -835,9 +835,8 @@ static int arp_process(struct sk_buff *skb) | |||
835 | } | 835 | } |
836 | goto out; | 836 | goto out; |
837 | } else if (IN_DEV_FORWARD(in_dev)) { | 837 | } else if (IN_DEV_FORWARD(in_dev)) { |
838 | if ((rt->rt_flags&RTCF_DNAT) || | 838 | if (addr_type == RTN_UNICAST && rt->u.dst.dev != dev && |
839 | (addr_type == RTN_UNICAST && rt->u.dst.dev != dev && | 839 | (arp_fwd_proxy(in_dev, rt) || pneigh_lookup(&arp_tbl, &init_net, &tip, dev, 0))) { |
840 | (arp_fwd_proxy(in_dev, rt) || pneigh_lookup(&arp_tbl, &init_net, &tip, dev, 0)))) { | ||
841 | n = neigh_event_ns(&arp_tbl, sha, &sip, dev); | 840 | n = neigh_event_ns(&arp_tbl, sha, &sip, dev); |
842 | if (n) | 841 | if (n) |
843 | neigh_release(n); | 842 | neigh_release(n); |
diff --git a/net/ipv4/route.c b/net/ipv4/route.c index 933b093721ea..78c4ce424a68 100644 --- a/net/ipv4/route.c +++ b/net/ipv4/route.c | |||
@@ -1768,7 +1768,7 @@ static inline int __mkroute_input(struct sk_buff *skb, | |||
1768 | if (err) | 1768 | if (err) |
1769 | flags |= RTCF_DIRECTSRC; | 1769 | flags |= RTCF_DIRECTSRC; |
1770 | 1770 | ||
1771 | if (out_dev == in_dev && err && !(flags & (RTCF_NAT | RTCF_MASQ)) && | 1771 | if (out_dev == in_dev && err && !(flags & RTCF_MASQ) && |
1772 | (IN_DEV_SHARED_MEDIA(out_dev) || | 1772 | (IN_DEV_SHARED_MEDIA(out_dev) || |
1773 | inet_addr_onlink(out_dev, saddr, FIB_RES_GW(*res)))) | 1773 | inet_addr_onlink(out_dev, saddr, FIB_RES_GW(*res)))) |
1774 | flags |= RTCF_DOREDIRECT; | 1774 | flags |= RTCF_DOREDIRECT; |
@@ -1777,7 +1777,7 @@ static inline int __mkroute_input(struct sk_buff *skb, | |||
1777 | /* Not IP (i.e. ARP). Do not create route, if it is | 1777 | /* Not IP (i.e. ARP). Do not create route, if it is |
1778 | * invalid for proxy arp. DNAT routes are always valid. | 1778 | * invalid for proxy arp. DNAT routes are always valid. |
1779 | */ | 1779 | */ |
1780 | if (out_dev == in_dev && !(flags & RTCF_DNAT)) { | 1780 | if (out_dev == in_dev) { |
1781 | err = -EINVAL; | 1781 | err = -EINVAL; |
1782 | goto cleanup; | 1782 | goto cleanup; |
1783 | } | 1783 | } |