Skip to content

Commit

Permalink
net/hsr: Added SET_NETDEV_DEVTYPE and features |= NETIF_F_NETNS_LOCAL…
Browse files Browse the repository at this point in the history
… to dev_setup.

Signed-off-by: Arvid Brodin <arvid.brodin@alten.se>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Arvid Brodin authored and davem330 committed Jul 8, 2014
1 parent 1cc1eb5 commit 4c3477d
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions net/hsr/hsr_device.c
Original file line number Diff line number Diff line change
Expand Up @@ -501,15 +501,19 @@ static const struct net_device_ops hsr_device_ops = {
.ndo_fix_features = hsr_fix_features,
};

static struct device_type hsr_type = {
.name = "hsr",
};

void hsr_dev_setup(struct net_device *dev)
{
random_ether_addr(dev->dev_addr);

ether_setup(dev);
dev->header_ops = &hsr_header_ops;
dev->netdev_ops = &hsr_device_ops;
dev->tx_queue_len = 0;
dev->header_ops = &hsr_header_ops;
dev->netdev_ops = &hsr_device_ops;
SET_NETDEV_DEVTYPE(dev, &hsr_type);
dev->tx_queue_len = 0;

dev->destructor = hsr_dev_destroy;

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


Expand Down

0 comments on commit 4c3477d

Please sign in to comment.