diff options
| author | Igor Ryzhov <iryzhov@nfware.com> | 2021-09-03 17:36:40 +0300 | 
|---|---|---|
| committer | Igor Ryzhov <iryzhov@nfware.com> | 2021-09-03 17:36:40 +0300 | 
| commit | 2c1eba8e848f424a59d187a63f6684f4327ab253 (patch) | |
| tree | 21b38ab31873f5ea35ddf9726b0afe39fa761557 /bgpd/bgp_network.c | |
| parent | 3cb67fef98c9869a2d2f3bf1be86c3b29cb0405e (diff) | |
bgpd: cleanup special checks for views
bgp->vrf_id is always VRF_DEFAULT for views. All these special checks
are not necessary.
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
Diffstat (limited to 'bgpd/bgp_network.c')
| -rw-r--r-- | bgpd/bgp_network.c | 11 | 
1 files changed, 3 insertions, 8 deletions
diff --git a/bgpd/bgp_network.c b/bgpd/bgp_network.c index 3005eba271..fd62a2fcef 100644 --- a/bgpd/bgp_network.c +++ b/bgpd/bgp_network.c @@ -173,9 +173,7 @@ static int bgp_md5_set_password(struct peer *peer, const char *password)  				 * must be the default vrf or a view instance  				 */  				if (!listener->bgp) { -					if (peer->bgp->vrf_id != VRF_DEFAULT -					    && peer->bgp->inst_type -						       != BGP_INSTANCE_TYPE_VIEW) +					if (peer->bgp->vrf_id != VRF_DEFAULT)  						continue;  				} else if (listener->bgp != peer->bgp)  					continue; @@ -853,8 +851,7 @@ static int bgp_listener(int sock, struct sockaddr *sa, socklen_t salen,  	listener->name = XSTRDUP(MTYPE_BGP_LISTENER, bgp->name);  	/* this socket is in a vrf record bgp back pointer */ -	if (bgp->vrf_id != VRF_DEFAULT -	    && bgp->inst_type != BGP_INSTANCE_TYPE_VIEW) +	if (bgp->vrf_id != VRF_DEFAULT)  		listener->bgp = bgp;  	memcpy(&listener->su, sa, salen); @@ -906,9 +903,7 @@ int bgp_socket(struct bgp *bgp, unsigned short port, const char *address)  			sock = vrf_socket(ainfo->ai_family,  					  ainfo->ai_socktype,  					  ainfo->ai_protocol, -					  (bgp->inst_type -					   != BGP_INSTANCE_TYPE_VIEW -					   ? bgp->vrf_id : VRF_DEFAULT), +					  bgp->vrf_id,  					  (bgp->inst_type  					   == BGP_INSTANCE_TYPE_VRF  					   ? bgp->name : NULL));  | 
