mirror of
https://github.com/systemd/systemd.git
synced 2024-10-30 06:25:37 +03:00
sd-radv: make several constants not exposed
This commit is contained in:
parent
d6fc0d674f
commit
03ec10fdf4
@ -12,7 +12,8 @@
|
||||
#include "sparse-endian.h"
|
||||
#include "time-util.h"
|
||||
|
||||
assert_cc(SD_RADV_DEFAULT_MIN_TIMEOUT_USEC <= SD_RADV_DEFAULT_MAX_TIMEOUT_USEC);
|
||||
#define RADV_DEFAULT_MAX_TIMEOUT_USEC (600 * USEC_PER_SEC)
|
||||
#define RADV_DEFAULT_MIN_TIMEOUT_USEC (200 * USEC_PER_SEC)
|
||||
|
||||
#define RADV_MAX_INITIAL_RTR_ADVERT_INTERVAL_USEC (16 * USEC_PER_SEC)
|
||||
#define RADV_MAX_INITIAL_RTR_ADVERTISEMENTS 3
|
||||
|
@ -293,7 +293,7 @@ static int radv_recv(sd_event_source *s, int fd, uint32_t revents, void *userdat
|
||||
}
|
||||
|
||||
static usec_t radv_compute_timeout(usec_t min, usec_t max) {
|
||||
assert_return(min <= max, SD_RADV_DEFAULT_MIN_TIMEOUT_USEC);
|
||||
assert_return(min <= max, RADV_DEFAULT_MIN_TIMEOUT_USEC);
|
||||
|
||||
/* RFC 4861: min must be no less than 3s, max must be no less than 4s */
|
||||
min = MAX(min, 3*USEC_PER_SEC);
|
||||
@ -324,8 +324,8 @@ static int radv_timeout(sd_event_source *s, uint64_t usec, void *userdata) {
|
||||
max_timeout = RADV_MAX_INITIAL_RTR_ADVERT_INTERVAL_USEC;
|
||||
min_timeout = RADV_MAX_INITIAL_RTR_ADVERT_INTERVAL_USEC / 3;
|
||||
} else {
|
||||
max_timeout = SD_RADV_DEFAULT_MAX_TIMEOUT_USEC;
|
||||
min_timeout = SD_RADV_DEFAULT_MIN_TIMEOUT_USEC;
|
||||
max_timeout = RADV_DEFAULT_MAX_TIMEOUT_USEC;
|
||||
min_timeout = RADV_DEFAULT_MIN_TIMEOUT_USEC;
|
||||
}
|
||||
|
||||
/* RFC 4861, Section 6.2.1, lifetime must be at least MaxRtrAdvInterval,
|
||||
|
@ -30,11 +30,6 @@
|
||||
|
||||
_SD_BEGIN_DECLARATIONS;
|
||||
|
||||
#define SD_RADV_DEFAULT_MIN_TIMEOUT_USEC (200*USEC_PER_SEC)
|
||||
#define SD_RADV_DEFAULT_MAX_TIMEOUT_USEC (600*USEC_PER_SEC)
|
||||
|
||||
#define SD_RADV_DEFAULT_DNS_LIFETIME_USEC (3*SD_RADV_DEFAULT_MAX_TIMEOUT_USEC)
|
||||
|
||||
typedef struct sd_radv sd_radv;
|
||||
typedef struct sd_radv_prefix sd_radv_prefix;
|
||||
typedef struct sd_radv_route_prefix sd_radv_route_prefix;
|
||||
|
Loading…
Reference in New Issue
Block a user