aboutsummaryrefslogtreecommitdiffstats
path: root/net/core/dev.c
diff options
context:
space:
mode:
authorPatrick McHardy <kaber@trash.net>2008-07-15 01:49:30 -0400
committerDavid S. Miller <davem@davemloft.net>2008-07-15 01:49:30 -0400
commitbc1d0411b804ad190cdadabac48a10067f17b9e6 (patch)
tree0a38da614b6bb46f2ffa2378aca25043a2b33a7c /net/core/dev.c
parent6aa895b047720f71ec4eb11452f7c3ce8426941f (diff)
vlan: deliver packets received with VLAN acceleration to network taps
When VLAN header stripping is used, packets currently bypass packet sockets (and other network taps) completely. For locally existing VLANs, they appear directly on the VLAN device, for unknown VLANs they are silently dropped. Add a new function netif_nit_deliver() to deliver incoming packets to all network interface taps and use it in __vlan_hwaccel_rx() to make VLAN packets visible on the underlying device. Signed-off-by: Patrick McHardy <kaber@trash.net> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core/dev.c')
-rw-r--r--net/core/dev.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/net/core/dev.c b/net/core/dev.c
index a29a359b15d1..feaab4898a5b 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -2068,6 +2068,33 @@ out:
2068} 2068}
2069#endif 2069#endif
2070 2070
2071/*
2072 * netif_nit_deliver - deliver received packets to network taps
2073 * @skb: buffer
2074 *
2075 * This function is used to deliver incoming packets to network
2076 * taps. It should be used when the normal netif_receive_skb path
2077 * is bypassed, for example because of VLAN acceleration.
2078 */
2079void netif_nit_deliver(struct sk_buff *skb)
2080{
2081 struct packet_type *ptype;
2082
2083 if (list_empty(&ptype_all))
2084 return;
2085
2086 skb_reset_network_header(skb);
2087 skb_reset_transport_header(skb);
2088 skb->mac_len = skb->network_header - skb->mac_header;
2089
2090 rcu_read_lock();
2091 list_for_each_entry_rcu(ptype, &ptype_all, list) {
2092 if (!ptype->dev || ptype->dev == skb->dev)
2093 deliver_skb(skb, ptype, skb->dev);
2094 }
2095 rcu_read_unlock();
2096}
2097
2071/** 2098/**
2072 * netif_receive_skb - process receive buffer from network 2099 * netif_receive_skb - process receive buffer from network
2073 * @skb: buffer to process 2100 * @skb: buffer to process