mirror of
				https://gitlab.labs.nic.cz/labs/bird.git
				synced 2024-05-11 16:54:54 +00:00 
			
		
		
		
	BGP: Add support for BGP hostname capability
This is an implementation of draft-walton-bgp-hostname-capability-02. It is implemented since quite some time for FRR and in datacenter, this gives a nice output to avoid using IP addresses. It is disabled by default. The hostname is retrieved from uname(2) and can be overriden with "hostname" option. The domain name is never set nor displayed. Minor changes by committer.
This commit is contained in:
		
				
					committed by
					
						
						Ondrej Zajicek (work)
					
				
			
			
				
	
			
			
			
						parent
						
							00b85905b9
						
					
				
				
					commit
					714238716e
				
			@@ -20,6 +20,7 @@
 | 
			
		||||
#include <pwd.h>
 | 
			
		||||
#include <grp.h>
 | 
			
		||||
#include <sys/stat.h>
 | 
			
		||||
#include <sys/utsname.h>
 | 
			
		||||
#include <libgen.h>
 | 
			
		||||
 | 
			
		||||
#include "nest/bird.h"
 | 
			
		||||
@@ -88,6 +89,21 @@ drop_gid(gid_t gid)
 | 
			
		||||
    die("setgroups: %m");
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 *	Hostname
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
char *
 | 
			
		||||
get_hostname(linpool *lp)
 | 
			
		||||
{
 | 
			
		||||
  struct utsname uts = {};
 | 
			
		||||
 | 
			
		||||
  if (uname(&uts) < 0)
 | 
			
		||||
      return NULL;
 | 
			
		||||
 | 
			
		||||
  return lp_strdup(lp, uts.nodename);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 *	Reading the Configuration
 | 
			
		||||
 */
 | 
			
		||||
 
 | 
			
		||||
@@ -24,6 +24,7 @@ extern int parse_and_exit;
 | 
			
		||||
void async_config(void);
 | 
			
		||||
void async_dump(void);
 | 
			
		||||
void async_shutdown(void);
 | 
			
		||||
char *get_hostname(linpool *lp);
 | 
			
		||||
void cmd_check_config(const char *name);
 | 
			
		||||
void cmd_reconfig(const char *name, int type, uint timeout);
 | 
			
		||||
void cmd_reconfig_confirm(void);
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user