From: Jukka Rissanen Date: Tue, 11 Sep 2012 12:01:16 +0000 (+0300) Subject: ipconfig: Catch interface name changes X-Git-Tag: 1.7~29 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=98919ac6cbc7535309d308363a249a0cdfe0af22;p=platform%2Fupstream%2Fconnman.git ipconfig: Catch interface name changes Update the ipdevice interface name if it is changed by udev. --- diff --git a/src/ipconfig.c b/src/ipconfig.c index e2b6576b..4d8c569e 100644 --- a/src/ipconfig.c +++ b/src/ipconfig.c @@ -632,8 +632,19 @@ void __connman_ipconfig_newlink(int index, unsigned short type, return; ipdevice = g_hash_table_lookup(ipdevice_hash, GINT_TO_POINTER(index)); - if (ipdevice != NULL) + if (ipdevice != NULL) { + char *ifname = connman_inet_ifname(index); + if (g_strcmp0(ipdevice->ifname, ifname) != 0) { + DBG("interface name changed %s -> %s", + ipdevice->ifname, ifname); + + g_free(ipdevice->ifname); + ipdevice->ifname = ifname; + } else + g_free(ifname); + goto update; + } ipdevice = g_try_new0(struct connman_ipdevice, 1); if (ipdevice == NULL)