-
- if (vlan_tx_tag_present(skb) && !dev_supports_vlan_tx(skb->dev)) {
- int features;
-
- features = netif_skb_features(skb);
-
- if (!vlan_tso)
- features &= ~(NETIF_F_TSO | NETIF_F_TSO6 |
- NETIF_F_UFO | NETIF_F_FSO);
-
- if (netif_needs_gso(skb, features)) {
- struct sk_buff *nskb;
-
- nskb = skb_gso_segment(skb, features);
- if (!nskb) {
- if (unlikely(skb_cloned(skb) &&
- pskb_expand_head(skb, 0, 0, GFP_ATOMIC)))
- goto drop;
-
- skb_shinfo(skb)->gso_type &= ~SKB_GSO_DODGY;
- goto tag;
- }
-
- if (IS_ERR(nskb))
- goto drop;
- consume_skb(skb);
- skb = nskb;
-
- len = 0;
- do {
- nskb = skb->next;
- skb->next = NULL;
-
- skb = __vlan_put_tag(skb, skb->vlan_proto, vlan_tx_tag_get(skb));
- if (likely(skb)) {
- len += skb->len;
- vlan_set_tci(skb, 0);
- dev_queue_xmit(skb);
- }
-
- skb = nskb;
- } while (skb);
-
- return len;
- }
-
-tag:
- skb = __vlan_put_tag(skb, skb->vlan_proto, vlan_tx_tag_get(skb));
- if (unlikely(!skb))
- return 0;
- vlan_set_tci(skb, 0);
- }
-