]> git.puffer.fish Git - matthieu/frr.git/commitdiff
bgpd: Fix standalone to better handle getsockopt failure
authorDonald Sharp <sharpd@cumulusnetworks.com>
Fri, 9 Sep 2016 12:48:23 +0000 (08:48 -0400)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Fri, 9 Sep 2016 12:51:45 +0000 (08:51 -0400)
When getsockopt(...,SO_BINDTODEVICE,...); fails
assume the bgp instance we are interested is the default
one.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
bgpd/bgp_network.c

index ecfc3f9fe8f596c4050427c4e8112013f5ddc08f..a6e9b7de00d5f9b94606d4f30d549f3716723dd9 100644 (file)
@@ -257,13 +257,14 @@ bgp_get_instance_for_inc_conn (int sock, struct bgp **bgp_inst)
       zlog_err ("[Error] BGP SO_BINDTODEVICE get failed (%s), sock %d",
                 safe_strerror (errno), sock);
       return -1;
-#else
-      strcpy (name, VRF_DEFAULT_NAME);
 #endif
     }
 
   if (!strlen(name))
-    return 0; /* default instance. */
+    {
+      *bgp_inst = bgp_get_default ();
+      return 0; /* default instance. */
+    }
 
   /* First try match to instance; if that fails, check for interfaces. */
   bgp = bgp_lookup_by_name (name);