summaryrefslogtreecommitdiffstats
path: root/net/hsr/hsr_device.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/hsr/hsr_device.c')
-rw-r--r--net/hsr/hsr_device.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/net/hsr/hsr_device.c b/net/hsr/hsr_device.c
index 4dc2a4207ee2..4e5d92a8f079 100644
--- a/net/hsr/hsr_device.c
+++ b/net/hsr/hsr_device.c
@@ -19,6 +19,7 @@
#include <linux/rtnetlink.h>
#include <linux/pkt_sched.h>
#include "hsr_device.h"
+#include "hsr_slave.h"
#include "hsr_framereg.h"
#include "hsr_main.h"
@@ -393,7 +394,6 @@ static void restore_slaves(struct net_device *hsr_dev)
rtnl_lock();
- /* Restore promiscuity */
for (i = 0; i < HSR_MAX_SLAVE; i++) {
if (!hsr->slave[i])
continue;
@@ -402,8 +402,12 @@ static void restore_slaves(struct net_device *hsr_dev)
netdev_info(hsr_dev,
"Cannot restore slave promiscuity (%s, %d)\n",
hsr->slave[i]->name, res);
+
+ if (hsr->slave[i]->rx_handler == hsr_handle_frame)
+ netdev_rx_handler_unregister(hsr->slave[i]);
}
+
rtnl_unlock();
}
@@ -575,6 +579,13 @@ int hsr_dev_finalize(struct net_device *hsr_dev, struct net_device *slave[2],
}
}
+ for (i = 0; i < HSR_MAX_SLAVE; i++) {
+ res = netdev_rx_handler_register(slave[i], hsr_handle_frame,
+ hsr);
+ if (res)
+ goto fail;
+ }
+
/* Make sure we recognize frames from ourselves in hsr_rcv() */
res = hsr_create_self_node(&hsr->self_node_db, hsr_dev->dev_addr,
hsr->slave[1]->dev_addr);