]> git.proxmox.com Git - mirror_frr.git/blob - bfdd/linux.c
Merge pull request #4230 from sworleys/Route-Info-Check
[mirror_frr.git] / bfdd / linux.c
1 /*
2 * Linux specific code
3 *
4 * Copyright (C) 2018 Network Device Education Foundation, Inc. ("NetDEF")
5 *
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
9 * later version.
10 *
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.
15 *
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
19 * 02111-1307, USA.
20 */
21
22 #include <zebra.h>
23
24 #ifdef BFD_LINUX
25
26 #include "bfd.h"
27
28
29 /*
30 * Definitions.
31 */
32 int bp_bind_dev(int sd __attribute__((__unused__)),
33 const char *dev __attribute__((__unused__)))
34 {
35 /*
36 * TODO: implement this differently. It is not possible to
37 * SO_BINDTODEVICE after the daemon has dropped its privileges.
38 */
39 #if 0
40 size_t devlen = strlen(dev) + 1;
41
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));
45 return -1;
46 }
47 #endif
48
49 return 0;
50 }
51
52 #endif /* BFD_LINUX */