mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-13 16:26:10 +00:00
bfdd: socket creation in a vrf can be done
vrf_socket() call is performed instead of socket() call. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
This commit is contained in:
parent
5764d816d3
commit
e52a638341
@ -49,6 +49,8 @@ DECLARE_MTYPE(BFDD_CONTROL);
|
||||
DECLARE_MTYPE(BFDD_SESSION_OBSERVER);
|
||||
DECLARE_MTYPE(BFDD_NOTIFICATION);
|
||||
|
||||
extern struct zebra_privs_t bfdd_privs;
|
||||
|
||||
struct bfd_timers {
|
||||
uint32_t desired_min_tx;
|
||||
uint32_t required_min_rx;
|
||||
|
@ -37,7 +37,6 @@
|
||||
|
||||
#include "bfd.h"
|
||||
|
||||
|
||||
/*
|
||||
* Prototypes
|
||||
*/
|
||||
@ -906,7 +905,10 @@ int bp_peer_socket(const struct bfd_session *bs)
|
||||
struct sockaddr_in sin;
|
||||
static int srcPort = BFD_SRCPORTINIT;
|
||||
|
||||
sd = socket(AF_INET, SOCK_DGRAM, PF_UNSPEC);
|
||||
frr_elevate_privs(&bfdd_privs) {
|
||||
sd = vrf_socket(AF_INET, SOCK_DGRAM, PF_UNSPEC,
|
||||
bs->vrf->vrf_id, NULL);
|
||||
}
|
||||
if (sd == -1) {
|
||||
log_error("ipv4-new: failed to create socket: %s",
|
||||
strerror(errno));
|
||||
@ -976,7 +978,10 @@ int bp_peer_socketv6(const struct bfd_session *bs)
|
||||
struct sockaddr_in6 sin6;
|
||||
static int srcPort = BFD_SRCPORTINIT;
|
||||
|
||||
sd = socket(AF_INET6, SOCK_DGRAM, PF_UNSPEC);
|
||||
frr_elevate_privs(&bfdd_privs) {
|
||||
sd = vrf_socket(AF_INET6, SOCK_DGRAM, PF_UNSPEC,
|
||||
bs->vrf->vrf_id, NULL);
|
||||
}
|
||||
if (sd == -1) {
|
||||
log_error("ipv6-new: failed to create socket: %s",
|
||||
strerror(errno));
|
||||
|
Loading…
Reference in New Issue
Block a user