#include "lldpd.h"
#include "trace.h"
+#include <sys/param.h>
#include <sys/utsname.h>
static ssize_t
cfg->g_config.c_tx_interval = config->c_tx_interval;
cfg->g_config.c_ttl =
cfg->g_config.c_tx_interval * cfg->g_config.c_tx_hold;
- cfg->g_config.c_ttl = (cfg->g_config.c_ttl + 999) / 1000;
+ cfg->g_config.c_ttl = MIN((cfg->g_config.c_ttl + 999) / 1000, 65535);
}
levent_send_now(cfg);
}
cfg->g_config.c_tx_hold = config->c_tx_hold;
cfg->g_config.c_ttl =
cfg->g_config.c_tx_interval * cfg->g_config.c_tx_hold;
- cfg->g_config.c_ttl = (cfg->g_config.c_ttl + 999) / 1000;
+ cfg->g_config.c_ttl = MIN((cfg->g_config.c_ttl + 999) / 1000, 65535);
}
if (CHANGED(c_max_neighbors) && config->c_max_neighbors > 0) {
log_debug("rpc", "client change maximum neighbors to %d",
#include <time.h>
#include <libgen.h>
#include <assert.h>
+#include <sys/param.h>
#include <sys/utsname.h>
#include <sys/types.h>
#include <sys/wait.h>
cfg->g_config.c_tx_interval = LLDPD_TX_INTERVAL * 1000;
cfg->g_config.c_tx_hold = LLDPD_TX_HOLD;
cfg->g_config.c_ttl = cfg->g_config.c_tx_interval * cfg->g_config.c_tx_hold;
- cfg->g_config.c_ttl = (cfg->g_config.c_ttl + 999) / 1000;
+ cfg->g_config.c_ttl = MIN((cfg->g_config.c_ttl + 999) / 1000, 65535);
cfg->g_config.c_max_neighbors = LLDPD_MAX_NEIGHBORS;
#ifdef ENABLE_LLDPMED
cfg->g_config.c_enable_fast_start = enable_fast_start;