]> git.puffer.fish Git - mirror/frr.git/commitdiff
bgpd: use macro HAVE_STRUCT_UTSNAME_DOMAINNAME to avoid compilation failures
authorMitesh Kanjariya <mitesh@marvel-07.cumulusnetworks.com>
Fri, 18 Aug 2017 04:08:33 +0000 (21:08 -0700)
committerMitesh Kanjariya <mitesh@marvel-07.cumulusnetworks.com>
Fri, 18 Aug 2017 04:08:33 +0000 (21:08 -0700)
Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
bgpd/bgpd.c

index a017c4fa263b02929caf314d4fc269f62d1acbfc..6cad2e97adec4e66f687a4488563e8515e9627a2 100644 (file)
@@ -2769,14 +2769,16 @@ static struct bgp *bgp_create(as_t *as, const char *name,
                XFREE(MTYPE_BGP_PEER_HOST, bgp->peer_self->hostname);
                bgp->peer_self->hostname = NULL;
        }
+       bgp->peer_self->hostname = XSTRDUP(MTYPE_BGP_PEER_HOST, names.nodename);
 
        if (bgp->peer_self->domainname != NULL) {
                XFREE(MTYPE_BGP_PEER_HOST, bgp->peer_self->domainname);
                bgp->peer_self->domainname = NULL;
        }
-       bgp->peer_self->hostname = XSTRDUP(MTYPE_BGP_PEER_HOST, names.nodename);
+#ifdef HAVE_STRUCT_UTSNAME_DOMAINNAME
        bgp->peer_self->domainname = XSTRDUP(MTYPE_BGP_PEER_HOST,
                                             names.domainname);
+#endif
        bgp->peer = list_new();
        bgp->peer->cmp = (int (*)(void *, void *))peer_cmp;
        bgp->peerhash = hash_create(peer_hash_key_make, peer_hash_same, NULL);