discover/network: Ignore tun devices
diff mbox

Message ID 20160810071318.12809-1-sam@mendozajonas.com
State Accepted
Headers show

Commit Message

Samuel Mendoza-Jonas Aug. 10, 2016, 7:13 a.m. UTC
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 | 3 +++
 1 file changed, 3 insertions(+)

Patch
diff mbox

diff --git a/discover/network.c b/discover/network.c
index 4b79015..2de96ec 100644
--- a/discover/network.c
+++ b/discover/network.c
@@ -515,6 +515,9 @@  static int network_handle_nlmsg(struct network *network, struct nlmsghdr *nlmsg)
 		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) {