From 714238716ef36f1dfc5721055e2ec4affd42ebfa Mon Sep 17 00:00:00 2001 From: Vincent Bernat Date: Wed, 10 Feb 2021 16:53:57 +0100 Subject: 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. --- proto/bgp/bgp.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'proto/bgp/bgp.c') diff --git a/proto/bgp/bgp.c b/proto/bgp/bgp.c index 302d026c..c54afe06 100644 --- a/proto/bgp/bgp.c +++ b/proto/bgp/bgp.c @@ -103,6 +103,7 @@ * RFC 8654 - Extended Message Support for BGP * draft-ietf-idr-ext-opt-param-07 * draft-uttaro-idr-bgp-persistence-04 + * draft-walton-bgp-hostname-capability-02 */ #undef LOCAL_DEBUG @@ -2415,6 +2416,9 @@ bgp_show_capabilities(struct bgp_proto *p UNUSED, struct bgp_caps *caps) bgp_show_afis(-1006, " AF supported:", afl1, afn1); bgp_show_afis(-1006, " AF preserved:", afl2, afn2); } + + if (caps->hostname) + cli_msg(-1006, " Hostname: %s", caps->hostname); } static void -- cgit v1.2.3