From 9e867fe663c4eb43c36f35067c0dd092e8c83c14 Mon Sep 17 00:00:00 2001 From: jardin Date: Tue, 23 Dec 2003 08:56:18 +0000 Subject: Merge isisd into the Quagga's framework: - add privs support - use misc quagga's definitions - make it compile"able" - fix segfault cases related to hostname() - add debug isis xxx command This patch has been approved by Paul Jakma. --- isisd/isis_misc.c | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) (limited to 'isisd/isis_misc.c') diff --git a/isisd/isis_misc.c b/isisd/isis_misc.c index 763ae243..cf558e83 100644 --- a/isisd/isis_misc.c +++ b/isisd/isis_misc.c @@ -28,12 +28,13 @@ #include #include #include - +#include #include "stream.h" #include "vty.h" #include "hash.h" #include "if.h" +#include "command.h" #include "isisd/dict.h" #include "isisd/isis_constants.h" @@ -432,7 +433,22 @@ newprefix2inaddr (u_char *prefix_start, u_char prefix_masklen) return new_prefix; } +/* + * Returns host.name if any, otherwise + * it returns the system hostname. + */ +const char * +unix_hostname(void) +{ + static struct utsname names; + const char *hostname; + extern struct host host; + + hostname = host.name; + if (!hostname) { + uname(&names); + hostname = names.nodename; + } - - - + return hostname; +} -- cgit v1.2.1