Commit 4a86fd9d authored by Juliusz Chroboczek's avatar Juliusz Chroboczek

Rename *_hello_interval to default_*_hello_interval.

They are no longer used except for configuring interfaces with no
explicit configuration.
parent 03bd8943
......@@ -62,8 +62,8 @@ time_t reboot_time;
int link_detect = 0;
int all_wireless = 0;
int wireless_hello_interval = -1;
int wired_hello_interval = -1;
int default_wireless_hello_interval = -1;
int default_wired_hello_interval = -1;
int resend_delay = -1;
int do_daemonise = 0;
char *logfile = NULL, *pidfile = "/var/run/babeld.pid";
......@@ -148,14 +148,15 @@ main(int argc, char **argv)
protocol_port = atoi(optarg);
break;
case 'h':
wireless_hello_interval = parse_msec(optarg);
if(wireless_hello_interval <= 0 ||
wireless_hello_interval > 0xFFFF * 10)
default_wireless_hello_interval = parse_msec(optarg);
if(default_wireless_hello_interval <= 0 ||
default_wireless_hello_interval > 0xFFFF * 10)
goto usage;
break;
case 'H':
wired_hello_interval = parse_msec(optarg);
if(wired_hello_interval <= 0 || wired_hello_interval > 0xFFFF * 10)
default_wired_hello_interval = parse_msec(optarg);
if(default_wired_hello_interval <= 0 ||
default_wired_hello_interval > 0xFFFF * 10)
goto usage;
break;
case 'k':
......@@ -261,17 +262,17 @@ main(int argc, char **argv)
"Warning: /etc/babel.conf exists, it will be ignored.\n");
}
if(wireless_hello_interval <= 0)
wireless_hello_interval = 4000;
wireless_hello_interval = MAX(wireless_hello_interval, 5);
if(default_wireless_hello_interval <= 0)
default_wireless_hello_interval = 4000;
default_wireless_hello_interval = MAX(default_wireless_hello_interval, 5);
if(wired_hello_interval <= 0)
wired_hello_interval = 4000;
wired_hello_interval = MAX(wired_hello_interval, 5);
if(default_wired_hello_interval <= 0)
default_wired_hello_interval = 4000;
default_wired_hello_interval = MAX(default_wired_hello_interval, 5);
resend_delay = 2000;
resend_delay = MIN(resend_delay, wireless_hello_interval / 2);
resend_delay = MIN(resend_delay, wired_hello_interval / 2);
resend_delay = MIN(resend_delay, default_wireless_hello_interval / 2);
resend_delay = MIN(resend_delay, default_wired_hello_interval / 2);
resend_delay = MAX(resend_delay, 20);
if(parasitic && allow_duplicates >= 0) {
......
......@@ -83,7 +83,7 @@ THE SOFTWARE.
extern struct timeval now;
extern int debug;
extern time_t reboot_time;
extern int wireless_hello_interval, wired_hello_interval;
extern int default_wireless_hello_interval, default_wired_hello_interval;
extern int resend_delay;
extern int link_detect;
extern int all_wireless;
......
......@@ -294,9 +294,9 @@ interface_up(struct interface *ifp, int up)
if(IF_CONF(ifp, hello_interval) > 0)
ifp->hello_interval = IF_CONF(ifp, hello_interval);
else if((ifp->flags & IF_WIRED))
ifp->hello_interval = wired_hello_interval;
ifp->hello_interval = default_wired_hello_interval;
else
ifp->hello_interval = wireless_hello_interval;
ifp->hello_interval = default_wireless_hello_interval;
ifp->update_interval =
IF_CONF(ifp, update_interval) > 0 ?
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment