Changli Gao b46ffb8545 netfilter: fix ipt_REJECT TCP RST routing for indev == outdev
ip_route_me_harder can't create the route cache when the outdev is the same
with the indev for the skbs whichout a valid protocol set.

__mkroute_input functions has this check:
1998         if (skb->protocol != htons(ETH_P_IP)) {
1999                 /* Not IP (i.e. ARP). Do not create route, if it is
2000                  * invalid for proxy arp. DNAT routes are always valid.
2001                  *
2002                  * Proxy arp feature have been extended to allow, ARP
2003                  * replies back to the same interface, to support
2004                  * Private VLAN switch technologies. See arp.c.
2005                  */
2006                 if (out_dev == in_dev &&
2007                     IN_DEV_PROXY_ARP_PVLAN(in_dev) == 0) {
2008                         err = -EINVAL;
2009                         goto cleanup;
2010                 }
2011         }

This patch gives the new skb a valid protocol to bypass this check. In order
to make ipt_REJECT work with bridges, you also need to enable ip_forward.

This patch also fixes a regression. When we used skb_copy_expand(), we
didn't have this issue stated above, as the protocol was properly set.

Signed-off-by: Changli Gao <xiaosuo@gmail.com>
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-09-22 13:13:32 -07:00
..
2010-07-12 12:57:54 -07:00
2010-09-08 21:45:01 -07:00
2010-02-22 16:20:22 -08:00
2010-07-12 12:57:54 -07:00
2010-07-12 12:57:54 -07:00
2010-09-20 10:06:12 -07:00
2010-06-28 23:24:29 -07:00
2010-02-22 16:20:22 -08:00
2010-06-10 23:31:35 -07:00
2008-10-07 08:38:24 +11:00
2010-06-30 13:31:19 -07:00
2010-07-12 12:57:54 -07:00
2010-06-10 23:31:35 -07:00
2010-06-26 22:00:03 -07:00
2009-03-02 03:00:15 -08:00
2009-03-02 03:00:15 -08:00
2010-09-20 15:42:05 -07:00
2009-05-25 22:44:59 -07:00
2010-09-20 15:42:05 -07:00
2010-07-12 12:57:54 -07:00
2010-09-08 21:45:01 -07:00
2010-07-12 12:57:54 -07:00
2010-07-12 12:57:54 -07:00