|
@@ -2481,10 +2481,10 @@ static int dev_gso_segment(struct sk_buff *skb, netdev_features_t features)
|
|
|
}
|
|
|
|
|
|
static netdev_features_t harmonize_features(struct sk_buff *skb,
|
|
|
- __be16 protocol, netdev_features_t features)
|
|
|
+ netdev_features_t features)
|
|
|
{
|
|
|
if (skb->ip_summed != CHECKSUM_NONE &&
|
|
|
- !can_checksum_protocol(features, protocol)) {
|
|
|
+ !can_checksum_protocol(features, skb_network_protocol(skb))) {
|
|
|
features &= ~NETIF_F_ALL_CSUM;
|
|
|
} else if (illegal_highdma(skb->dev, skb)) {
|
|
|
features &= ~NETIF_F_SG;
|
|
@@ -2505,20 +2505,18 @@ netdev_features_t netif_skb_features(struct sk_buff *skb)
|
|
|
struct vlan_ethhdr *veh = (struct vlan_ethhdr *)skb->data;
|
|
|
protocol = veh->h_vlan_encapsulated_proto;
|
|
|
} else if (!vlan_tx_tag_present(skb)) {
|
|
|
- return harmonize_features(skb, protocol, features);
|
|
|
+ return harmonize_features(skb, features);
|
|
|
}
|
|
|
|
|
|
features &= (skb->dev->vlan_features | NETIF_F_HW_VLAN_CTAG_TX |
|
|
|
NETIF_F_HW_VLAN_STAG_TX);
|
|
|
|
|
|
- if (protocol != htons(ETH_P_8021Q) && protocol != htons(ETH_P_8021AD)) {
|
|
|
- return harmonize_features(skb, protocol, features);
|
|
|
- } else {
|
|
|
+ if (protocol == htons(ETH_P_8021Q) || protocol == htons(ETH_P_8021AD))
|
|
|
features &= NETIF_F_SG | NETIF_F_HIGHDMA | NETIF_F_FRAGLIST |
|
|
|
NETIF_F_GEN_CSUM | NETIF_F_HW_VLAN_CTAG_TX |
|
|
|
NETIF_F_HW_VLAN_STAG_TX;
|
|
|
- return harmonize_features(skb, protocol, features);
|
|
|
- }
|
|
|
+
|
|
|
+ return harmonize_features(skb, features);
|
|
|
}
|
|
|
EXPORT_SYMBOL(netif_skb_features);
|
|
|
|