… | |
… | |
145 | void configuration::init () |
145 | void configuration::init () |
146 | { |
146 | { |
147 | memset (this, 0, sizeof (*this)); |
147 | memset (this, 0, sizeof (*this)); |
148 | |
148 | |
149 | mtu = DEFAULT_MTU; |
149 | mtu = DEFAULT_MTU; |
|
|
150 | nfmark = 0; |
150 | rekey = DEFAULT_REKEY; |
151 | rekey = DEFAULT_REKEY; |
151 | keepalive = DEFAULT_KEEPALIVE; |
152 | keepalive = DEFAULT_KEEPALIVE; |
152 | llevel = L_INFO; |
153 | llevel = L_INFO; |
153 | ip_proto = IPPROTO_GRE; |
154 | ip_proto = IPPROTO_GRE; |
154 | #if ENABLE_ICMP |
155 | #if ENABLE_ICMP |
… | |
… | |
184 | if (rsa_key) |
185 | if (rsa_key) |
185 | RSA_free (rsa_key); |
186 | RSA_free (rsa_key); |
186 | |
187 | |
187 | rsa_key = 0; |
188 | rsa_key = 0; |
188 | |
189 | |
189 | free (pidfilename); pidfilename = 0; |
190 | free (pidfilename); pidfilename = 0; |
190 | free (ifname); ifname = 0; |
191 | free (ifname); ifname = 0; |
191 | #if ENABLE_HTTP_PROXY |
192 | #if ENABLE_HTTP_PROXY |
192 | free (proxy_host); proxy_host = 0; |
193 | free (proxy_host); proxy_host = 0; |
193 | free (proxy_auth); proxy_auth = 0; |
194 | free (proxy_auth); proxy_auth = 0; |
194 | #endif |
195 | #endif |
195 | #if ENABLE_DNS |
196 | #if ENABLE_DNS |
196 | free (dns_forw_host); dns_forw_host = 0; |
197 | free (dns_forw_host); dns_forw_host = 0; |
197 | #endif |
198 | #endif |
|
|
199 | free (script_if_up); script_if_up = 0; |
|
|
200 | free (script_node_up); script_node_up = 0; |
|
|
201 | free (script_node_change); script_node_change = 0; |
|
|
202 | free (script_node_down); script_node_down = 0; |
198 | } |
203 | } |
199 | |
204 | |
200 | void |
205 | void |
201 | configuration::clear () |
206 | configuration::clear () |
202 | { |
207 | { |
… | |
… | |
330 | conf.rekey = atoi (val); |
335 | conf.rekey = atoi (val); |
331 | else if (!strcmp (var, "keepalive")) |
336 | else if (!strcmp (var, "keepalive")) |
332 | conf.keepalive = atoi (val); |
337 | conf.keepalive = atoi (val); |
333 | else if (!strcmp (var, "mtu")) |
338 | else if (!strcmp (var, "mtu")) |
334 | conf.mtu = atoi (val); |
339 | conf.mtu = atoi (val); |
|
|
340 | else if (!strcmp (var, "nfmark")) |
|
|
341 | conf.nfmark = atoi (val); |
335 | else if (!strcmp (var, "if-up")) |
342 | else if (!strcmp (var, "if-up")) |
336 | free (conf.script_if_up), conf.script_if_up = strdup (val); |
343 | free (conf.script_if_up), conf.script_if_up = strdup (val); |
337 | else if (!strcmp (var, "node-up")) |
344 | else if (!strcmp (var, "node-up")) |
338 | free (conf.script_node_up), conf.script_node_up = strdup (val); |
345 | free (conf.script_node_up), conf.script_node_up = strdup (val); |
|
|
346 | else if (!strcmp (var, "node-change")) |
|
|
347 | free (conf.script_node_change), conf.script_node_change = strdup (val); |
339 | else if (!strcmp (var, "node-down")) |
348 | else if (!strcmp (var, "node-down")) |
340 | free (conf.script_node_down), conf.script_node_down = strdup (val); |
349 | free (conf.script_node_down), conf.script_node_down = strdup (val); |
341 | else if (!strcmp (var, "pid-file")) |
350 | else if (!strcmp (var, "pid-file")) |
342 | free (conf.pidfilename), conf.pidfilename = strdup (val); |
351 | free (conf.pidfilename), conf.pidfilename = strdup (val); |
343 | else if (!strcmp (var, "dns-forw-host")) |
352 | else if (!strcmp (var, "dns-forw-host")) |
… | |
… | |
494 | { |
503 | { |
495 | slog (L_WARN, _("%s: max-queue value invalid, setting it to 1."), nodename); |
504 | slog (L_WARN, _("%s: max-queue value invalid, setting it to 1."), nodename); |
496 | max_queue = 1; |
505 | max_queue = 1; |
497 | } |
506 | } |
498 | |
507 | |
499 | if (routerprio && (connectmode != C_ALWAYS && connectmode != C_DISABLED)) |
508 | if (routerprio > 1 && (connectmode != C_ALWAYS && connectmode != C_DISABLED)) |
500 | { |
509 | { |
501 | //slog (L_WARN, _("%s: has non-zero router-priority but either 'never' or 'ondemand' as connectmode, setting it to 'always'."), nodename); |
510 | //slog (L_WARN, _("%s: has non-zero router-priority but either 'never' or 'ondemand' as connectmode, setting it to 'always'."), nodename); |
502 | connectmode = C_ALWAYS; |
511 | connectmode = C_ALWAYS; |
503 | } |
512 | } |
504 | } |
513 | } |