From 749229fa367aed0bb14822a4e2fbbf112d06033e Mon Sep 17 00:00:00 2001 From: Håkon Nessjøen Date: Wed, 3 Nov 2010 03:12:11 +0100 Subject: Skip loopback interfaces. They seldom/never have a MAC address, and you probably won't run a MAC-Telnet server there. Speeds up autodetect. --- mactelnet.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/mactelnet.c b/mactelnet.c index 762d7b5..7f60712 100644 --- a/mactelnet.c +++ b/mactelnet.c @@ -247,6 +247,11 @@ int findInterface() { while (success = getIps(devicename, 128, &myip)) { char str[INET_ADDRSTRLEN]; + /* Skip loopback interfaces */ + if (memcmp("lo", devicename, 2) == 0) { + continue; + } + inet_ntop(AF_INET, &(myip.sin_addr), str, INET_ADDRSTRLEN); /* Initialize receiving socket on the device chosen */ -- cgit v1.2.3