summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--bgpd/bgp_open.c7
-rwxr-xr-xconfigure.ac5
2 files changed, 11 insertions, 1 deletions
diff --git a/bgpd/bgp_open.c b/bgpd/bgp_open.c
index 947f5c09d..876548888 100644
--- a/bgpd/bgp_open.c
+++ b/bgpd/bgp_open.c
@@ -1473,7 +1473,7 @@ bgp_open_capability (struct stream *s, struct peer *peer)
stream_putc(s, len);
stream_put(s, names.nodename, len);
-#ifdef _GNU_SOURCE
+#ifdef HAVE_STRUCT_UTSNAME_DOMAINNAME
if ((names.domainname[0] != '\0') &&
(strcmp(names.domainname, "(none)") != 0))
{
@@ -1497,8 +1497,13 @@ bgp_open_capability (struct stream *s, struct peer *peer)
stream_putc_at(s, capp, len);
if (bgp_debug_neighbor_events(peer))
+#ifdef HAVE_STRUCT_UTSNAME_DOMAINNAME
zlog_debug("%s Sending hostname cap with hn = %s, dn = %s",
peer->host, names.nodename, names.domainname);
+#else
+ zlog_debug("%s Sending hostname cap with hn = %s", peer->host,
+ names.nodename);
+#endif
}
/* Sending base graceful-restart capability irrespective of the config */
diff --git a/configure.ac b/configure.ac
index 9cdf1903d..6f07f10cd 100755
--- a/configure.ac
+++ b/configure.ac
@@ -1098,6 +1098,11 @@ AC_SUBST(IPFORWARD)
AC_CHECK_FUNCS(getaddrinfo, [have_getaddrinfo=yes], [have_getaddrinfo=no])
+dnl ----------------------------------------------------------------------------
+dnl figure out if domainname is available in the utsname struct (GNU extension).
+dnl ----------------------------------------------------------------------------
+AC_CHECK_MEMBERS([struct utsname.domainname], [], [], [#include <sys/utsname.h>])
+
dnl ----------
dnl IPv6 check
dnl ----------