aboutsummaryrefslogtreecommitdiffstats
path: root/net/8021q
diff options
context:
space:
mode:
Diffstat (limited to 'net/8021q')
-rw-r--r--net/8021q/vlan_core.c53
1 files changed, 0 insertions, 53 deletions
diff --git a/net/8021q/vlan_core.c b/net/8021q/vlan_core.c
index 75d427763992..90cc2bdd4064 100644
--- a/net/8021q/vlan_core.c
+++ b/net/8021q/vlan_core.c
@@ -112,59 +112,6 @@ __be16 vlan_dev_vlan_proto(const struct net_device *dev)
112} 112}
113EXPORT_SYMBOL(vlan_dev_vlan_proto); 113EXPORT_SYMBOL(vlan_dev_vlan_proto);
114 114
115static struct sk_buff *vlan_reorder_header(struct sk_buff *skb)
116{
117 if (skb_cow(skb, skb_headroom(skb)) < 0) {
118 kfree_skb(skb);
119 return NULL;
120 }
121
122 memmove(skb->data - ETH_HLEN, skb->data - VLAN_ETH_HLEN, 2 * ETH_ALEN);
123 skb->mac_header += VLAN_HLEN;
124 return skb;
125}
126
127struct sk_buff *vlan_untag(struct sk_buff *skb)
128{
129 struct vlan_hdr *vhdr;
130 u16 vlan_tci;
131
132 if (unlikely(vlan_tx_tag_present(skb))) {
133 /* vlan_tci is already set-up so leave this for another time */
134 return skb;
135 }
136
137 skb = skb_share_check(skb, GFP_ATOMIC);
138 if (unlikely(!skb))
139 goto err_free;
140
141 if (unlikely(!pskb_may_pull(skb, VLAN_HLEN)))
142 goto err_free;
143
144 vhdr = (struct vlan_hdr *) skb->data;
145 vlan_tci = ntohs(vhdr->h_vlan_TCI);
146 __vlan_hwaccel_put_tag(skb, skb->protocol, vlan_tci);
147
148 skb_pull_rcsum(skb, VLAN_HLEN);
149 vlan_set_encap_proto(skb, vhdr);
150
151 skb = vlan_reorder_header(skb);
152 if (unlikely(!skb))
153 goto err_free;
154
155 skb_reset_network_header(skb);
156 skb_reset_transport_header(skb);
157 skb_reset_mac_len(skb);
158
159 return skb;
160
161err_free:
162 kfree_skb(skb);
163 return NULL;
164}
165EXPORT_SYMBOL(vlan_untag);
166
167
168/* 115/*
169 * vlan info and vid list 116 * vlan info and vid list
170 */ 117 */