]>
git.proxmox.com Git - mirror_frr.git/blob - bfdd/linux.c
4 * Copyright (C) 2018 Network Device Education Foundation, Inc. ("NetDEF")
6 * FRR is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the
8 * Free Software Foundation; either version 2, or (at your option) any
11 * FRR is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with FRR; see the file COPYING. If not, write to the Free
18 * Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
32 int bp_bind_dev(int sd
__attribute__((__unused__
)),
33 const char *dev
__attribute__((__unused__
)))
36 * TODO: implement this differently. It is not possible to
37 * SO_BINDTODEVICE after the daemon has dropped its privileges.
40 size_t devlen
= strlen(dev
) + 1;
42 if (setsockopt(sd
, SOL_SOCKET
, SO_BINDTODEVICE
, dev
, devlen
) == -1) {
43 log_warning("%s: setsockopt(SO_BINDTODEVICE, \"%s\"): %s",
44 __func__
, dev
, strerror(errno
));
52 #endif /* BFD_LINUX */