diff options
author | Marcel Holtmann <marcel@holtmann.org> | 2010-07-15 12:03:37 -0700 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2010-07-15 12:03:37 -0700 |
commit | 5c455337d8432d97f0904481e2258ed3df837c58 (patch) | |
tree | 09f8ae3e01ea7a7ffdf49525797e3cb2cc60c540 /src/rtnl.c | |
parent | d6aab12f5335c45a008e84d600f77839b13d0565 (diff) | |
download | connman-5c455337d8432d97f0904481e2258ed3df837c58.tar.gz connman-5c455337d8432d97f0904481e2258ed3df837c58.tar.bz2 connman-5c455337d8432d97f0904481e2258ed3df837c58.zip |
Fix Ethernet service type detection
Diffstat (limited to 'src/rtnl.c')
-rw-r--r-- | src/rtnl.c | 18 |
1 files changed, 12 insertions, 6 deletions
@@ -96,10 +96,18 @@ static void read_uevent(struct interface_data *interface) char *filename, line[128]; FILE *f; + if (ether_blacklisted(interface->name) == TRUE) + interface->type = CONNMAN_SERVICE_TYPE_UNKNOWN; + else + interface->type = CONNMAN_SERVICE_TYPE_ETHERNET; + filename = g_strdup_printf("/sys/class/net/%s/uevent", interface->name); f = fopen(filename, "re"); + + g_free(filename); + if (f == NULL) return; @@ -122,6 +130,8 @@ static void read_uevent(struct interface_data *interface) interface->type = CONNMAN_SERVICE_TYPE_BLUETOOTH; else if (strcmp(line + 8, "wimax") == 0) interface->type = CONNMAN_SERVICE_TYPE_WIMAX; + else + interface->type = CONNMAN_SERVICE_TYPE_UNKNOWN; } fclose(f); @@ -404,12 +414,8 @@ static void process_newlink(unsigned short type, int index, unsigned flags, g_hash_table_insert(interface_list, GINT_TO_POINTER(index), interface); - read_uevent(interface); - - if (interface->type == CONNMAN_SERVICE_TYPE_UNKNOWN && - type == ARPHRD_ETHER && - ether_blacklisted(ifname) == FALSE) - interface->type = CONNMAN_SERVICE_TYPE_ETHERNET; + if (type == ARPHRD_ETHER) + read_uevent(interface); __connman_technology_add_interface(interface->type, interface->index, interface->name); |