Commit 09d99f10 authored by Juliusz Chroboczek's avatar Juliusz Chroboczek

Add option "router-id", remove command-line flag "-R".

parent 765c90e9
...@@ -129,7 +129,7 @@ main(int argc, char **argv) ...@@ -129,7 +129,7 @@ main(int argc, char **argv)
while(1) { while(1) {
opt = getopt(argc, argv, opt = getopt(argc, argv,
"m:p:h:H:i:k:A:srR:uS:d:g:lwz:M:t:T:c:C:DL:I:"); "m:p:h:H:i:k:A:sruS:d:g:lwz:M:t:T:c:C:DL:I:");
if(opt < 0) if(opt < 0)
break; break;
...@@ -182,12 +182,6 @@ main(int argc, char **argv) ...@@ -182,12 +182,6 @@ main(int argc, char **argv)
case 'r': case 'r':
random_id = 1; random_id = 1;
break; break;
case 'R':
rc = parse_eui64(optarg, myid);
if(rc < 0)
goto usage;
have_id = 1;
break;
case 'u': case 'u':
keep_unfeasible = 1; keep_unfeasible = 1;
break; break;
......
...@@ -94,6 +94,7 @@ extern int all_wireless; ...@@ -94,6 +94,7 @@ extern int all_wireless;
extern int has_ipv6_subtrees; extern int has_ipv6_subtrees;
extern unsigned char myid[8]; extern unsigned char myid[8];
extern int have_id;
extern const unsigned char zeroes[16], ones[16]; extern const unsigned char zeroes[16], ones[16];
......
...@@ -94,11 +94,6 @@ derived from the MAC address of the first interface, which is easier ...@@ -94,11 +94,6 @@ derived from the MAC address of the first interface, which is easier
to debug and more reliably prevents routing loops but may sometimes to debug and more reliably prevents routing loops but may sometimes
cause a node to be unreachable for 120 seconds just after boot. cause a node to be unreachable for 120 seconds just after boot.
.TP .TP
.BI \-R " router-id"
Specify the router-id explicitly, as a modified EUI-64 or a MAC-48
address. If two nodes have the same router-id, bad things will happen.
Don't use this option unless you know what you are doing.
.TP
.B \-u .B \-u
Do not flush unfeasible (useless) routes. This is useful in order to Do not flush unfeasible (useless) routes. This is useful in order to
announce more information to a front-end (see announce more information to a front-end (see
...@@ -258,6 +253,11 @@ If this flag is set, no kernel (sysctl) setup is performed on startup. This can ...@@ -258,6 +253,11 @@ If this flag is set, no kernel (sysctl) setup is performed on startup. This can
be useful when running in environments where system permissions prevent setting be useful when running in environments where system permissions prevent setting
kernel parameters, for instance inside a Linux container. kernel parameters, for instance inside a Linux container.
.TP .TP
.BI router-id " id"
Specify the router-id explicitly, as a modified EUI-64 or a MAC-48
address. If two nodes have the same router-id, bad things will happen.
Don't use this option unless you know what you are doing.
.TP
.BI state-file " filename" .BI state-file " filename"
This specifies the name of the file used for preserving long-term This specifies the name of the file used for preserving long-term
information between invocations of the information between invocations of the
......
...@@ -782,6 +782,14 @@ parse_option(int c, gnc_t gnc, void *closure, char *token) ...@@ -782,6 +782,14 @@ parse_option(int c, gnc_t gnc, void *closure, char *token)
if(c < -1 || n <= 0 || n + SRC_TABLE_NUM >= 32765) if(c < -1 || n <= 0 || n + SRC_TABLE_NUM >= 32765)
goto error; goto error;
src_table_prio = n; src_table_prio = n;
} else if(strcmp(token, "router-id") == 0) {
unsigned char *id = NULL;
c = getid(c, &id, gnc, closure);
if(c < -1 || id == NULL)
goto error;
memcpy(myid, id, 8);
free(id);
have_id = 1;
} else { } else {
goto error; goto error;
} }
......
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