core: use IFF_LOWER_UP instead of IFF_RUNNING for carrier (lp #332064)
We really have wanted to use IFF_LOWER_UP since 2.6.17 for carrier status, since that's tied to netif_carrier_ok()/netif_carrier_on() in the kernel. See kernel commit b00055aacdb172c05067612278ba27265fcd05ce for the introduction of IFF_LOWER_UP.
This commit is contained in:
@@ -32,7 +32,7 @@
|
||||
#include <linux/types.h>
|
||||
#include <linux/netlink.h>
|
||||
#include <linux/rtnetlink.h>
|
||||
#include <net/if.h>
|
||||
#include <linux/if.h>
|
||||
#include <linux/unistd.h>
|
||||
#include <unistd.h>
|
||||
#include <stdio.h>
|
||||
@@ -206,7 +206,11 @@ netlink_object_message_handler (struct nl_object *obj, void *arg)
|
||||
|
||||
link_obj = (struct rtnl_link *) obj;
|
||||
flags = rtnl_link_get_flags (link_obj);
|
||||
if (flags & IFF_RUNNING) {
|
||||
|
||||
/* IFF_LOWER_UP is the indicator of carrier status since kernel commit
|
||||
* b00055aacdb172c05067612278ba27265fcd05ce in 2.6.17.
|
||||
*/
|
||||
if (flags & IFF_LOWER_UP) {
|
||||
g_signal_emit (G_OBJECT (monitor),
|
||||
signals[CARRIER_ON],
|
||||
0, rtnl_link_get_ifindex (link_obj));
|
||||
|
Reference in New Issue
Block a user