Add -n getopt'ion --- a/src/daemon/lldpd.c +++ b/src/daemon/lldpd.c @@ -1451,8 +1451,9 @@ * unless there is a very good reason. Most command-line options will * get deprecated at some point. */ char *popt, opts[] = - "H:vhkrdD:p:xX:m:u:4:6:I:C:p:M:P:S:iL:@ "; + "n:H:vhkrdD:p:xX:m:u:4:6:I:C:p:M:P:S:iL:@ "; int i, found, advertise_version = 1; + int max_neighbors = LLDPD_MAX_NEIGHBORS; #ifdef ENABLE_LLDPMED int lldpmed = 0, noinventory = 0; int enable_fast_start = 1; @@ -1492,6 +1493,9 @@ } while ((ch = getopt(argc, argv, opts)) != -1) { switch (ch) { + case 'n': + max_neighbors = atoi(optarg); + break; case 'h': usage(); break; @@ -1758,7 +1762,7 @@ cfg->g_config.c_receiveonly = receiveonly; cfg->g_config.c_tx_interval = LLDPD_TX_INTERVAL; cfg->g_config.c_tx_hold = LLDPD_TX_HOLD; - cfg->g_config.c_max_neighbors = LLDPD_MAX_NEIGHBORS; + cfg->g_config.c_max_neighbors = max_neighbors; #ifdef ENABLE_LLDPMED cfg->g_config.c_enable_fast_start = enable_fast_start; cfg->g_config.c_tx_fast_init = LLDPD_FAST_INIT;