On Sun, 2005-24-07 at 19:02 -0700, David S. Miller wrote:

I agree they will mean the same thing. 
The example i gave was to show where one meaning contradicts the other.

> And the current specific settings of input_dev has the following
> problems:
> 
> 1) you cannot ingress classify on tunneling virtual devices, since
>    ->input_dev only gets set for (some) hardware device types
> 
> 2) not all hardware device types are supported, because we have
>    to add specific settings of ->input_dev, which is just broken
> 

I worry that not all possible packet origins have been caught.
But thats why the printk exists with no ratelimiting ;->
Infact, thats exactly how we caught/fixed most.

> I have never ever seen one good argument for the way input_dev
> is set now, and your new response is no different.
> 

The input_dev could be set by different actions depending on some policy
(whether it is mirred action redirecting to ingress or simple
meta action just setting it to something just because the admin is on
crack). I dont wanna prejudge why it is set. I know of a few places
where i can clearly set them (which is where they are being set at the
moment) and I am trying to catch others with that printk. The rest is
left to the clever admin.

> Why, for example, are hardware devices any different from virtual ones
> for ingress classification purposes? 

Weird. I just scanned the git/2614 and you are correct.
I am pretty sure that you ACKed quiet a few changes i sent that were
caught by the printk.
I attached the few i could find.

>  A clean generic interface would
> consider them the same and equally specifyable.  Right?
> 
> Every time a driver decapsulation happens (regardless of whether
> this is some hardware or virtual device), we have a new input
> device to classify upon.  I don't see why you wish to continue
> breaking this logical representation.
> 

I dont wanna break any good stuff that exists. I just wanna provide
ability to add more places where i override things.

cheers,
jamal
--- a/net/ipv4/ip_output.c      2004/12/31 14:26:08     1.1
+++ b/net/ipv4/ip_output.c      2004/12/31 14:27:53
@@ -111,6 +111,7 @@
 #ifdef CONFIG_NETFILTER_DEBUG
        nf_debug_ip_loopback_xmit(newskb);
 #endif
+       newskb->input_dev = newskb->dev;
        netif_rx(newskb);
        return 0;
 }
--- a/net/ipv6/ip6_output.c     2004-12-24 16:33:51.000000000 -0500
+++ b/net/ipv6/ip6_output.c     2004-12-31 10:29:47.505392096 -0500
@@ -102,7 +102,7 @@
        newskb->pkt_type = PACKET_LOOPBACK;
        newskb->ip_summed = CHECKSUM_UNNECESSARY;
        BUG_TRAP(newskb->dst);
-
+       newskb->input_dev = newskb->dev;
        netif_rx(newskb);
        return 0;
 }
--- 2610-bk1/net/ipv4/xfrm4_input.c     2004/12/31 17:00:25     1.1
+++ 2610-bk1/net/ipv4/xfrm4_input.c     2004/12/31 17:01:05
@@ -142,6 +142,7 @@
                        dst_release(skb->dst);
                        skb->dst = NULL;
                }
+               skb->input_dev = skb->dev;
                netif_rx(skb);
                return 0;
        } else {
--- 2610-bk1/net/ipv4/ipmr.c    2004/12/31 17:01:24     1.1
+++ 2610-bk1/net/ipv4/ipmr.c    2004/12/31 17:01:54
@@ -1461,6 +1461,7 @@
        ((struct net_device_stats*)reg_dev->priv)->rx_bytes += skb->len;
        ((struct net_device_stats*)reg_dev->priv)->rx_packets++;
        nf_reset(skb);
+       skb->input_dev = skb->dev;
        netif_rx(skb);
        dev_put(reg_dev);
        return 0;
@@ -1516,6 +1517,7 @@
        ((struct net_device_stats*)reg_dev->priv)->rx_bytes += skb->len;
        ((struct net_device_stats*)reg_dev->priv)->rx_packets++;
        skb->dst = NULL;
+       skb->input_dev = skb->dev;
        nf_reset(skb);
        netif_rx(skb);
        dev_put(reg_dev);
--- 2610-bk1/net/ipv4/ip_gre.c  2004/12/31 17:02:02     1.1
+++ 2610-bk1/net/ipv4/ip_gre.c  2004/12/31 17:03:08
@@ -655,6 +655,7 @@
                skb->dst = NULL;
                nf_reset(skb);
                ipgre_ecn_decapsulate(iph, skb);
+               skb->input_dev = skb->dev;
                netif_rx(skb);
                read_unlock(&ipgre_lock);
                return(0);
--- 2610-bk1/net/ipv4/ipip.c    2004/12/31 17:03:24     1.1
+++ 2610-bk1/net/ipv4/ipip.c    2004/12/31 17:03:52
@@ -497,6 +497,7 @@
                skb->dst = NULL;
                nf_reset(skb);
                ipip_ecn_decapsulate(iph, skb);
+               skb->input_dev = skb->dev;
                netif_rx(skb);
                read_unlock(&ipip_lock);
                return 0;
--- 2610-bk1/net/ipv6/ip6_tunnel.c      2004/12/31 17:06:12     1.1
+++ 2610-bk1/net/ipv6/ip6_tunnel.c      2004/12/31 17:07:03
@@ -547,6 +547,7 @@
                ip6ip6_ecn_decapsulate(ipv6h, skb);
                t->stat.rx_packets++;
                t->stat.rx_bytes += skb->len;
+               skb->input_dev = skb->dev;
                netif_rx(skb);
                read_unlock(&ip6ip6_lock);
                return 0;
--- 2610-bk1/net/ipv6/xfrm6_input.c     2004/12/31 17:07:18     1.1
+++ 2610-bk1/net/ipv6/xfrm6_input.c     2004/12/31 17:07:45
@@ -126,6 +126,7 @@
                        dst_release(skb->dst);
                        skb->dst = NULL;
                }
+               skb->input_dev = skb->dev;
                netif_rx(skb);
                return -1;
        } else {
--- a/net/ipv4/ip_output.c      2004/12/31 14:26:08     1.1
+++ b/net/ipv4/ip_output.c      2004/12/31 14:27:53
@@ -111,6 +111,7 @@
 #ifdef CONFIG_NETFILTER_DEBUG
        nf_debug_ip_loopback_xmit(newskb);
 #endif
+       newskb->input_dev = newskb->dev;
        netif_rx(newskb);
        return 0;
 }
--- a/net/ipv6/ip6_output.c     2004-12-24 16:33:51.000000000 -0500
+++ b/net/ipv6/ip6_output.c     2004-12-31 10:29:47.505392096 -0500
@@ -102,7 +102,7 @@
        newskb->pkt_type = PACKET_LOOPBACK;
        newskb->ip_summed = CHECKSUM_UNNECESSARY;
        BUG_TRAP(newskb->dst);
-
+       newskb->input_dev = newskb->dev;
        netif_rx(newskb);
        return 0;
 }
--- a/net/ipv6/sit.c    2004/12/31 11:03:32     1.1
+++ b/net/ipv6/sit.c    2004/12/31 11:06:50
@@ -385,7 +385,7 @@
                skb->pkt_type = PACKET_HOST;
                tunnel->stat.rx_packets++;
                tunnel->stat.rx_bytes += skb->len;
-               skb->dev = tunnel->dev;
+               skb->input_dev = skb->dev = tunnel->dev;
                dst_release(skb->dst);
                skb->dst = NULL;
                nf_reset(skb);
--- a/drivers/isdn/i4l/isdn_net.c       2005-03-02 02:38:33.000000000 -0500
+++ b/drivers/isdn/i4l/isdn_net.c       2005-03-10 21:15:59.451485136 -0500
@@ -1786,6 +1786,7 @@
                lp->stats.rx_bytes += skb->len;
        }
        skb->dev = ndev;
+       skb->input_dev = ndev;
        skb->pkt_type = PACKET_HOST;
        skb->mac.raw = skb->data;
 #ifdef ISDN_DEBUG_NET_DUMP
--- a/drivers/isdn/i4l/isdn_ppp.c       2005-03-02 02:38:13.000000000 -0500
+++ b/drivers/isdn/i4l/isdn_ppp.c       2005-03-10 21:12:47.069731608 -0500
@@ -1178,6 +1178,7 @@
                mlp->huptimer = 0;
 #endif /* CONFIG_IPPP_FILTER */
        skb->dev = dev;
+       skb->input_dev = dev;
        skb->mac.raw = skb->data;
        netif_rx(skb);
        /* net_dev->local->stats.rx_packets++; done in isdn_net.c */
--- a/net/ipv6/sit.c    2004/12/31 11:03:32     1.1
+++ b/net/ipv6/sit.c    2004/12/31 11:06:50
@@ -385,7 +385,7 @@
                skb->pkt_type = PACKET_HOST;
                tunnel->stat.rx_packets++;
                tunnel->stat.rx_bytes += skb->len;
-               skb->dev = tunnel->dev;
+               skb->input_dev = skb->dev = tunnel->dev;
                dst_release(skb->dst);
                skb->dst = NULL;
                nf_reset(skb);

Reply via email to