diff options
-rw-r--r-- | mactelnet.c | 5 |
1 files changed, 5 insertions, 0 deletions
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 */ |