|
@@ -372,11 +372,17 @@ void br_features_recompute(struct net_bridge *br)
|
|
|
struct net_bridge_port *p;
|
|
|
unsigned long features, checksum;
|
|
|
|
|
|
- features = br->feature_mask &~ NETIF_F_IP_CSUM;
|
|
|
- checksum = br->feature_mask & NETIF_F_IP_CSUM;
|
|
|
+ checksum = br->feature_mask & NETIF_F_ALL_CSUM ? NETIF_F_NO_CSUM : 0;
|
|
|
+ features = br->feature_mask & ~NETIF_F_ALL_CSUM;
|
|
|
|
|
|
list_for_each_entry(p, &br->port_list, list) {
|
|
|
- if (!(p->dev->features & NETIF_F_ALL_CSUM))
|
|
|
+ if (checksum & NETIF_F_NO_CSUM &&
|
|
|
+ !(p->dev->features & NETIF_F_NO_CSUM))
|
|
|
+ checksum ^= NETIF_F_NO_CSUM | NETIF_F_HW_CSUM;
|
|
|
+ if (checksum & NETIF_F_HW_CSUM &&
|
|
|
+ !(p->dev->features & NETIF_F_HW_CSUM))
|
|
|
+ checksum ^= NETIF_F_HW_CSUM | NETIF_F_IP_CSUM;
|
|
|
+ if (!(p->dev->features & NETIF_F_IP_CSUM))
|
|
|
checksum = 0;
|
|
|
features &= p->dev->features;
|
|
|
}
|