]> git.ozlabs.org Git - petitboot/commitdiff
discover/network: Ignore tun devices v1.2.3
authorSamuel Mendoza-Jonas <sam@mendozajonas.com>
Thu, 30 Jun 2016 06:13:58 +0000 (16:13 +1000)
committerSamuel Mendoza-Jonas <sam@mendozajonas.com>
Tue, 23 Aug 2016 00:56:45 +0000 (10:56 +1000)
In some environments a default 'tun' device is created. Petitboot
doesn't use this and it clutters up the list of network devices, so
ignore it if it is encountered.

Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
discover/network.c

index 4b79015c24a2ec52dc83db86a5e2b633729ca449..2de96ec55d1f061fc301dc9b36fe717c8b3c0a5b 100644 (file)
@@ -515,6 +515,9 @@ static int network_handle_nlmsg(struct network *network, struct nlmsghdr *nlmsg)
                return 0;
        }
 
                return 0;
        }
 
+       /* ignore the default tun device in some environments */
+       if (strncmp(ifname, "tun", strlen("tun")) == 0)
+               return 0;
 
        interface = find_interface_by_ifindex(network, info->ifi_index);
        if (!interface) {
 
        interface = find_interface_by_ifindex(network, info->ifi_index);
        if (!interface) {