diff options
| author | Donald Sharp <donaldsharp72@gmail.com> | 2023-01-31 08:46:03 -0500 | 
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-01-31 08:46:03 -0500 | 
| commit | d829de917876060ac3094b8bd651d8b84622cb87 (patch) | |
| tree | 259cf0857e2f192a5a7e195fcbcfc05ee0376431 /bgpd | |
| parent | 8c02dce8e95190662befb63cf0d86f629584bdc1 (diff) | |
| parent | d188b08f3027b466ae9e3476f340469c5f9052c9 (diff) | |
Merge pull request #12710 from opensourcerouting/fix/reset_fqdn_capability_on_before_handling_open
bgpd: Vanish FQDN capability hostname/domainname before handling new BGP OPEN
Diffstat (limited to 'bgpd')
| -rw-r--r-- | bgpd/bgp_fsm.c | 18 | ||||
| -rw-r--r-- | bgpd/bgpd.c | 1 | 
2 files changed, 9 insertions, 10 deletions
diff --git a/bgpd/bgp_fsm.c b/bgpd/bgp_fsm.c index c57e148ef8..9624adfbe2 100644 --- a/bgpd/bgp_fsm.c +++ b/bgpd/bgp_fsm.c @@ -279,22 +279,20 @@ static struct peer *peer_xfer_conn(struct peer *from_peer)  		}  	} +	if (peer->hostname) { +		XFREE(MTYPE_BGP_PEER_HOST, peer->hostname); +		peer->hostname = NULL; +	}  	if (from_peer->hostname != NULL) { -		if (peer->hostname) { -			XFREE(MTYPE_BGP_PEER_HOST, peer->hostname); -			peer->hostname = NULL; -		} -  		peer->hostname = from_peer->hostname;  		from_peer->hostname = NULL;  	} +	if (peer->domainname) { +		XFREE(MTYPE_BGP_PEER_HOST, peer->domainname); +		peer->domainname = NULL; +	}  	if (from_peer->domainname != NULL) { -		if (peer->domainname) { -			XFREE(MTYPE_BGP_PEER_HOST, peer->domainname); -			peer->domainname = NULL; -		} -  		peer->domainname = from_peer->domainname;  		from_peer->domainname = NULL;  	} diff --git a/bgpd/bgpd.c b/bgpd/bgpd.c index 1fd394a849..39010e76f9 100644 --- a/bgpd/bgpd.c +++ b/bgpd/bgpd.c @@ -1156,6 +1156,7 @@ static void peer_free(struct peer *peer)  	XFREE(MTYPE_PEER_DESC, peer->desc);  	XFREE(MTYPE_BGP_PEER_HOST, peer->host); +	XFREE(MTYPE_BGP_PEER_HOST, peer->hostname);  	XFREE(MTYPE_BGP_PEER_HOST, peer->domainname);  	XFREE(MTYPE_BGP_PEER_IFNAME, peer->ifname);  | 
