summaryrefslogtreecommitdiff
path: root/src/rtnl.c
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2012-09-21 10:38:15 +0300
committerPatrik Flykt <patrik.flykt@linux.intel.com>2012-09-24 11:07:50 +0300
commitbaca46719603974ed6849996c50a66f4ebeb5ff1 (patch)
tree60881d3961f9ac2aa790fb088fc9f362f96264bb /src/rtnl.c
parent0102a3fb69c0e4ba5504f9ae4fe7d94998813373 (diff)
downloadconnman-baca46719603974ed6849996c50a66f4ebeb5ff1.tar.gz
connman-baca46719603974ed6849996c50a66f4ebeb5ff1.tar.bz2
connman-baca46719603974ed6849996c50a66f4ebeb5ff1.zip
rtnl: Ignore netlink messages generated by wext
ConnMan should just ignore netlink messages generated by wext as described in commit 4997f6e38f34effc00179e849dee0dc2e2263d3a. Handle wext message detection using the IFLA_WIRELESS type because the ifinfomsg ifi_change field is reserved for future use and code using it for wext detection has been removed.
Diffstat (limited to 'src/rtnl.c')
-rw-r--r--src/rtnl.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/src/rtnl.c b/src/rtnl.c
index e4b35c2c..5f3fe155 100644
--- a/src/rtnl.c
+++ b/src/rtnl.c
@@ -356,10 +356,10 @@ static const char *operstate2str(unsigned char operstate)
return "";
}
-static void extract_link(struct ifinfomsg *msg, int bytes,
+static connman_bool_t extract_link(struct ifinfomsg *msg, int bytes,
struct ether_addr *address, const char **ifname,
unsigned int *mtu, unsigned char *operstate,
- struct rtnl_link_stats *stats)
+ struct rtnl_link_stats *stats)
{
struct rtattr *attr;
@@ -389,8 +389,12 @@ static void extract_link(struct ifinfomsg *msg, int bytes,
break;
case IFLA_LINKMODE:
break;
+ case IFLA_WIRELESS:
+ return FALSE;
}
}
+
+ return TRUE;
}
static void process_newlink(unsigned short type, int index, unsigned flags,
@@ -407,7 +411,9 @@ static void process_newlink(unsigned short type, int index, unsigned flags,
GSList *list;
memset(&stats, 0, sizeof(stats));
- extract_link(msg, bytes, &address, &ifname, &mtu, &operstate, &stats);
+ if (extract_link(msg, bytes, &address, &ifname, &mtu, &operstate,
+ &stats) == FALSE)
+ return;
snprintf(ident, 13, "%02x%02x%02x%02x%02x%02x",
address.ether_addr_octet[0],
@@ -489,7 +495,9 @@ static void process_dellink(unsigned short type, int index, unsigned flags,
GSList *list;
memset(&stats, 0, sizeof(stats));
- extract_link(msg, bytes, NULL, &ifname, NULL, &operstate, &stats);
+ if (extract_link(msg, bytes, NULL, &ifname, NULL, &operstate,
+ &stats) == FALSE)
+ return;
if (operstate != 0xff)
connman_info("%s {dellink} index %d operstate %u <%s>",