diff options
Diffstat (limited to 'net/hsr/hsr_device.c')
-rw-r--r-- | net/hsr/hsr_device.c | 13 |
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 @@ | |||
19 | #include <linux/rtnetlink.h> | 19 | #include <linux/rtnetlink.h> |
20 | #include <linux/pkt_sched.h> | 20 | #include <linux/pkt_sched.h> |
21 | #include "hsr_device.h" | 21 | #include "hsr_device.h" |
22 | #include "hsr_slave.h" | ||
22 | #include "hsr_framereg.h" | 23 | #include "hsr_framereg.h" |
23 | #include "hsr_main.h" | 24 | #include "hsr_main.h" |
24 | 25 | ||
@@ -393,7 +394,6 @@ static void restore_slaves(struct net_device *hsr_dev) | |||
393 | 394 | ||
394 | rtnl_lock(); | 395 | rtnl_lock(); |
395 | 396 | ||
396 | /* Restore promiscuity */ | ||
397 | for (i = 0; i < HSR_MAX_SLAVE; i++) { | 397 | for (i = 0; i < HSR_MAX_SLAVE; i++) { |
398 | if (!hsr->slave[i]) | 398 | if (!hsr->slave[i]) |
399 | continue; | 399 | continue; |
@@ -402,8 +402,12 @@ static void restore_slaves(struct net_device *hsr_dev) | |||
402 | netdev_info(hsr_dev, | 402 | netdev_info(hsr_dev, |
403 | "Cannot restore slave promiscuity (%s, %d)\n", | 403 | "Cannot restore slave promiscuity (%s, %d)\n", |
404 | hsr->slave[i]->name, res); | 404 | hsr->slave[i]->name, res); |
405 | |||
406 | if (hsr->slave[i]->rx_handler == hsr_handle_frame) | ||
407 | netdev_rx_handler_unregister(hsr->slave[i]); | ||
405 | } | 408 | } |
406 | 409 | ||
410 | |||
407 | rtnl_unlock(); | 411 | rtnl_unlock(); |
408 | } | 412 | } |
409 | 413 | ||
@@ -575,6 +579,13 @@ int hsr_dev_finalize(struct net_device *hsr_dev, struct net_device *slave[2], | |||
575 | } | 579 | } |
576 | } | 580 | } |
577 | 581 | ||
582 | for (i = 0; i < HSR_MAX_SLAVE; i++) { | ||
583 | res = netdev_rx_handler_register(slave[i], hsr_handle_frame, | ||
584 | hsr); | ||
585 | if (res) | ||
586 | goto fail; | ||
587 | } | ||
588 | |||
578 | /* Make sure we recognize frames from ourselves in hsr_rcv() */ | 589 | /* Make sure we recognize frames from ourselves in hsr_rcv() */ |
579 | res = hsr_create_self_node(&hsr->self_node_db, hsr_dev->dev_addr, | 590 | res = hsr_create_self_node(&hsr->self_node_db, hsr_dev->dev_addr, |
580 | hsr->slave[1]->dev_addr); | 591 | hsr->slave[1]->dev_addr); |