Merge pull request #8688 from idryzhov/bgp-vrf-bind-priv

bgpd: raise privs for SO_BINDTODEVICE
This commit is contained in:
Donatas Abraitis 2021-05-19 10:02:20 +03:00 committed by GitHub
commit 2794d40202
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -572,7 +572,9 @@ static int bgp_accept(struct thread *thread)
peer->doppelganger = peer1;
peer1->doppelganger = peer;
peer->fd = bgp_sock;
vrf_bind(peer->bgp->vrf_id, bgp_sock, bgp_get_bound_name(peer));
frr_with_privs(&bgpd_privs) {
vrf_bind(peer->bgp->vrf_id, bgp_sock, bgp_get_bound_name(peer));
}
bgp_peer_reg_with_nht(peer);
bgp_fsm_change_status(peer, Active);
BGP_TIMER_OFF(peer->t_start); /* created in peer_create() */