Skip to content

Commit 4c3477d

Browse files
Arvid Brodindavem330
authored andcommitted
net/hsr: Added SET_NETDEV_DEVTYPE and features |= NETIF_F_NETNS_LOCAL to dev_setup.
Signed-off-by: Arvid Brodin <arvid.brodin@alten.se> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 1cc1eb5 commit 4c3477d

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

net/hsr/hsr_device.c

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -501,15 +501,19 @@ static const struct net_device_ops hsr_device_ops = {
501501
.ndo_fix_features = hsr_fix_features,
502502
};
503503

504+
static struct device_type hsr_type = {
505+
.name = "hsr",
506+
};
504507

505508
void hsr_dev_setup(struct net_device *dev)
506509
{
507510
random_ether_addr(dev->dev_addr);
508511

509512
ether_setup(dev);
510-
dev->header_ops = &hsr_header_ops;
511-
dev->netdev_ops = &hsr_device_ops;
512-
dev->tx_queue_len = 0;
513+
dev->header_ops = &hsr_header_ops;
514+
dev->netdev_ops = &hsr_device_ops;
515+
SET_NETDEV_DEVTYPE(dev, &hsr_type);
516+
dev->tx_queue_len = 0;
513517

514518
dev->destructor = hsr_dev_destroy;
515519

@@ -525,6 +529,10 @@ void hsr_dev_setup(struct net_device *dev)
525529
* hsr_header_create() etc.
526530
*/
527531
dev->features |= NETIF_F_VLAN_CHALLENGED;
532+
/* Not sure about this. Taken from bridge code. netdev_features.h says
533+
* it means "Does not change network namespaces".
534+
*/
535+
dev->features |= NETIF_F_NETNS_LOCAL;
528536
}
529537

530538

0 commit comments

Comments
 (0)