mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-04-30 03:00:24 +00:00
Merge pull request #11067 from donaldsharp/domainname
lib: Ensure an empty string does not get printed for host/domain
This commit is contained in:
commit
d45a846e5c
@ -445,11 +445,15 @@ static bool full_cli;
|
|||||||
/* This function write configuration of this host. */
|
/* This function write configuration of this host. */
|
||||||
static int config_write_host(struct vty *vty)
|
static int config_write_host(struct vty *vty)
|
||||||
{
|
{
|
||||||
if (cmd_hostname_get())
|
const char *name;
|
||||||
vty_out(vty, "hostname %s\n", cmd_hostname_get());
|
|
||||||
|
|
||||||
if (cmd_domainname_get())
|
name = cmd_hostname_get();
|
||||||
vty_out(vty, "domainname %s\n", cmd_domainname_get());
|
if (name && name[0] != '\0')
|
||||||
|
vty_out(vty, "hostname %s\n", name);
|
||||||
|
|
||||||
|
name = cmd_domainname_get();
|
||||||
|
if (name && name[0] != '\0')
|
||||||
|
vty_out(vty, "domainname %s\n", name);
|
||||||
|
|
||||||
/* The following are all configuration commands that are not sent to
|
/* The following are all configuration commands that are not sent to
|
||||||
* watchfrr. For instance watchfrr is hardcoded to log to syslog so
|
* watchfrr. For instance watchfrr is hardcoded to log to syslog so
|
||||||
|
Loading…
Reference in New Issue
Block a user