Browse Source

KWSys 2016-11-16 (a0c60eec)

Code extracted from:

    http://public.kitware.com/KWSys.git

at commit a0c60eec7cdbe7b5d0196bfc5b69bd969fe8786f (master).

Upstream Shortlog
-----------------

Brad King (2):
      818405fc Fix typo in clang-format script documentation
      a0c60eec Terminal: Add tmux to VT100 color support whitelist

Matt Leotta (1):
      6a642f72 SystemInformation: Skip loopback devices in search for FQDN
KWSys Upstream 9 years ago
parent
commit
572ac89773
2 changed files with 8 additions and 1 deletions
  1. 6 1
      SystemInformation.cxx
  2. 2 0
      Terminal.c

+ 6 - 1
SystemInformation.cxx

@@ -79,6 +79,7 @@ typedef int siginfo_t;
 #include <sys/sysctl.h>
 #include <sys/sysctl.h>
 #if defined(KWSYS_SYS_HAS_IFADDRS_H)
 #if defined(KWSYS_SYS_HAS_IFADDRS_H)
 #include <ifaddrs.h>
 #include <ifaddrs.h>
+#include <net/if.h>
 #define KWSYS_SYSTEMINFORMATION_IMPLEMENT_FQDN
 #define KWSYS_SYSTEMINFORMATION_IMPLEMENT_FQDN
 #endif
 #endif
 #endif
 #endif
@@ -99,6 +100,7 @@ typedef int siginfo_t;
 #include <sys/sysctl.h>
 #include <sys/sysctl.h>
 #if defined(KWSYS_SYS_HAS_IFADDRS_H)
 #if defined(KWSYS_SYS_HAS_IFADDRS_H)
 #include <ifaddrs.h>
 #include <ifaddrs.h>
+#include <net/if.h>
 #define KWSYS_SYSTEMINFORMATION_IMPLEMENT_FQDN
 #define KWSYS_SYSTEMINFORMATION_IMPLEMENT_FQDN
 #endif
 #endif
 #if !(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ - 0 >= 1050)
 #if !(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ - 0 >= 1050)
@@ -113,6 +115,7 @@ typedef int siginfo_t;
 #include <sys/socket.h>
 #include <sys/socket.h>
 #if defined(KWSYS_SYS_HAS_IFADDRS_H)
 #if defined(KWSYS_SYS_HAS_IFADDRS_H)
 #include <ifaddrs.h>
 #include <ifaddrs.h>
+#include <net/if.h>
 #if !defined(__LSB_VERSION__) /* LSB has no getifaddrs */
 #if !defined(__LSB_VERSION__) /* LSB has no getifaddrs */
 #define KWSYS_SYSTEMINFORMATION_IMPLEMENT_FQDN
 #define KWSYS_SYSTEMINFORMATION_IMPLEMENT_FQDN
 #endif
 #endif
@@ -1696,7 +1699,9 @@ int SystemInformationImplementation::GetFullyQualifiedDomainName(
 
 
   for (ifa = ifas; ifa != NULL; ifa = ifa->ifa_next) {
   for (ifa = ifas; ifa != NULL; ifa = ifa->ifa_next) {
     int fam = ifa->ifa_addr ? ifa->ifa_addr->sa_family : -1;
     int fam = ifa->ifa_addr ? ifa->ifa_addr->sa_family : -1;
-    if ((fam == AF_INET) || (fam == AF_INET6)) {
+    // Skip Loopback interfaces
+    if (((fam == AF_INET) || (fam == AF_INET6)) &&
+        !(ifa->ifa_flags & IFF_LOOPBACK)) {
       char host[NI_MAXHOST] = { '\0' };
       char host[NI_MAXHOST] = { '\0' };
 
 
       const size_t addrlen = (fam == AF_INET ? sizeof(struct sockaddr_in)
       const size_t addrlen = (fam == AF_INET ? sizeof(struct sockaddr_in)

+ 2 - 0
Terminal.c

@@ -150,6 +150,8 @@ static const char* kwsysTerminalVT100Names[] = { "Eterm",
                                                  "screen-bce",
                                                  "screen-bce",
                                                  "screen-w",
                                                  "screen-w",
                                                  "screen.linux",
                                                  "screen.linux",
+                                                 "tmux",
+                                                 "tmux-256color",
                                                  "vt100",
                                                  "vt100",
                                                  "xterm",
                                                  "xterm",
                                                  "xterm-16color",
                                                  "xterm-16color",