* bgpd.h: add a BGP_OPT_NO_LISTEN option for the master BGP configuration,
to prevent any listen socket being created automatically. Allows code
to be used outside of BGP daemon settings.
* bgpd.c: (bgp_get) honour above the flag, suppress auto-creation of listen
socket on first BGP instance if set.
(bgp_option_set) whitelist BGP_OPT_NO_LISTEN
case BGP_OPT_NO_FIB:
case BGP_OPT_MULTIPLE_INSTANCE:
case BGP_OPT_CONFIG_CISCO:
+ case BGP_OPT_NO_LISTEN:
SET_FLAG (bm->options, flag);
break;
default:
*bgp_val = bgp;
/* Create BGP server socket, if first instance. */
- if (list_isempty(bm->bgp))
+ if (list_isempty(bm->bgp)
+ && !bgp_option_check (BGP_OPT_NO_LISTEN))
{
if (bgp_socket (bm->port, bm->address) < 0)
return BGP_ERR_INVALID_VALUE;
#define BGP_OPT_NO_FIB (1 << 0)
#define BGP_OPT_MULTIPLE_INSTANCE (1 << 1)
#define BGP_OPT_CONFIG_CISCO (1 << 2)
+#define BGP_OPT_NO_LISTEN (1 << 3)
};
/* BGP instance structure. */