[IPV4]: Remove unsupported DNAT (RTCF_NAT and RTCF_NAT) in IPV4
authorRami Rosen <ramirose@gmail.com>
Wed, 9 Jan 2008 08:18:24 +0000 (00:18 -0800)
committerDavid S. Miller <davem@davemloft.net>
Mon, 28 Jan 2008 23:01:07 +0000 (15:01 -0800)
- 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>
net/ipv4/arp.c
net/ipv4/route.c

index 9eb6d3ab297727adbec17e369d793932abd9895f..46edf1c32a401815b5dba37faa786377752c903d 100644 (file)
@@ -835,9 +835,8 @@ static int arp_process(struct sk_buff *skb)
                        }
                        goto out;
                } else if (IN_DEV_FORWARD(in_dev)) {
-                       if ((rt->rt_flags&RTCF_DNAT) ||
-                           (addr_type == RTN_UNICAST  && rt->u.dst.dev != dev &&
-                            (arp_fwd_proxy(in_dev, rt) || pneigh_lookup(&arp_tbl, &init_net, &tip, dev, 0)))) {
+                           if (addr_type == RTN_UNICAST  && rt->u.dst.dev != dev &&
+                            (arp_fwd_proxy(in_dev, rt) || pneigh_lookup(&arp_tbl, &init_net, &tip, dev, 0))) {
                                n = neigh_event_ns(&arp_tbl, sha, &sip, dev);
                                if (n)
                                        neigh_release(n);
index 933b093721eab5afa49978ba7bdf102561316830..78c4ce424a68e672e045d807fc7d8593adeb6b1a 100644 (file)
@@ -1768,7 +1768,7 @@ static inline int __mkroute_input(struct sk_buff *skb,
        if (err)
                flags |= RTCF_DIRECTSRC;
 
-       if (out_dev == in_dev && err && !(flags & (RTCF_NAT | RTCF_MASQ)) &&
+       if (out_dev == in_dev && err && !(flags & RTCF_MASQ) &&
            (IN_DEV_SHARED_MEDIA(out_dev) ||
             inet_addr_onlink(out_dev, saddr, FIB_RES_GW(*res))))
                flags |= RTCF_DOREDIRECT;
@@ -1777,7 +1777,7 @@ static inline int __mkroute_input(struct sk_buff *skb,
                /* Not IP (i.e. ARP). Do not create route, if it is
                 * invalid for proxy arp. DNAT routes are always valid.
                 */
-               if (out_dev == in_dev && !(flags & RTCF_DNAT)) {
+               if (out_dev == in_dev) {
                        err = -EINVAL;
                        goto cleanup;
                }