mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-15 18:56:40 +00:00
Merge pull request #2037 from coreswitch/master
bgpd option '-p 0' means do not listen BGP port.
This commit is contained in:
commit
8227cf9333
@ -337,7 +337,7 @@ int main(int argc, char **argv)
|
|||||||
frr_preinit(&bgpd_di, argc, argv);
|
frr_preinit(&bgpd_di, argc, argv);
|
||||||
frr_opt_add(
|
frr_opt_add(
|
||||||
"p:l:rSne:", longopts,
|
"p:l:rSne:", longopts,
|
||||||
" -p, --bgp_port Set bgp protocol's port number\n"
|
" -p, --bgp_port Set BGP listen port number (0 means do not listen).\n"
|
||||||
" -l, --listenon Listen on specified address (implies -n)\n"
|
" -l, --listenon Listen on specified address (implies -n)\n"
|
||||||
" -r, --retain When program terminates, retain added route by bgpd.\n"
|
" -r, --retain When program terminates, retain added route by bgpd.\n"
|
||||||
" -n, --no_kernel Do not install route to kernel.\n"
|
" -n, --no_kernel Do not install route to kernel.\n"
|
||||||
@ -356,7 +356,7 @@ int main(int argc, char **argv)
|
|||||||
break;
|
break;
|
||||||
case 'p':
|
case 'p':
|
||||||
tmp_port = atoi(optarg);
|
tmp_port = atoi(optarg);
|
||||||
if (tmp_port <= 0 || tmp_port > 0xffff)
|
if (tmp_port < 0 || tmp_port > 0xffff)
|
||||||
bgp_port = BGP_PORT_DEFAULT;
|
bgp_port = BGP_PORT_DEFAULT;
|
||||||
else
|
else
|
||||||
bgp_port = tmp_port;
|
bgp_port = tmp_port;
|
||||||
@ -395,6 +395,8 @@ int main(int argc, char **argv)
|
|||||||
/* BGP master init. */
|
/* BGP master init. */
|
||||||
bgp_master_init(frr_init());
|
bgp_master_init(frr_init());
|
||||||
bm->port = bgp_port;
|
bm->port = bgp_port;
|
||||||
|
if (bgp_port == 0)
|
||||||
|
bgp_option_set(BGP_OPT_NO_LISTEN);
|
||||||
bm->address = bgp_address;
|
bm->address = bgp_address;
|
||||||
if (no_fib_flag)
|
if (no_fib_flag)
|
||||||
bgp_option_set(BGP_OPT_NO_FIB);
|
bgp_option_set(BGP_OPT_NO_FIB);
|
||||||
|
@ -29,7 +29,8 @@ be specified (:ref:`common-invocation-options`).
|
|||||||
.. option:: -p <port>
|
.. option:: -p <port>
|
||||||
.. option:: --bgp_port <port>
|
.. option:: --bgp_port <port>
|
||||||
|
|
||||||
Set the bgp protocol's port number.
|
Set the bgp protocol's port number. When port number is 0, that means do not
|
||||||
|
listen bgp port.
|
||||||
|
|
||||||
.. option:: -r
|
.. option:: -r
|
||||||
.. option:: --retain
|
.. option:: --retain
|
||||||
|
Loading…
Reference in New Issue
Block a user