summaryrefslogtreecommitdiff
path: root/bgpd/bgp_network.c
diff options
context:
space:
mode:
Diffstat (limited to 'bgpd/bgp_network.c')
-rw-r--r--bgpd/bgp_network.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/bgpd/bgp_network.c b/bgpd/bgp_network.c
index 61972aabf1..0caada488b 100644
--- a/bgpd/bgp_network.c
+++ b/bgpd/bgp_network.c
@@ -33,6 +33,7 @@ Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
#include "network.h"
#include "queue.h"
#include "hash.h"
+#include "filter.h"
#include "bgpd/bgpd.h"
#include "bgpd/bgp_open.h"
@@ -228,6 +229,17 @@ bgp_set_socket_ttl (struct peer *peer, int bgp_sock)
static int
bgp_get_instance_for_inc_conn (int sock, struct bgp **bgp_inst)
{
+#ifndef SO_BINDTODEVICE
+ /* only Linux has SO_BINDTODEVICE, but we're in Linux-specific code here
+ * anyway since the assumption is that the interface name returned by
+ * getsockopt() is useful in identifying the VRF, particularly with Linux's
+ * VRF l3master device. The whole mechanism is specific to Linux, so...
+ * when other platforms add VRF support, this will need handling here as
+ * well. (or, some restructuring) */
+ *bgp_inst = bgp_get_default ();
+ return !*bgp_inst;
+
+#else
char name[VRF_NAMSIZ + 1];
socklen_t name_len = VRF_NAMSIZ;
struct bgp *bgp;
@@ -275,6 +287,7 @@ bgp_get_instance_for_inc_conn (int sock, struct bgp **bgp_inst)
/* We didn't match to either an instance or an interface. */
return -1;
+#endif
}
/* Accept bgp connection. */