… | |
… | |
329 | exit (EXIT_FAILURE); |
329 | exit (EXIT_FAILURE); |
330 | } |
330 | } |
331 | |
331 | |
332 | fcntl (tap->fd, F_SETFD, FD_CLOEXEC); |
332 | fcntl (tap->fd, F_SETFD, FD_CLOEXEC); |
333 | |
333 | |
|
|
334 | run_script_cb cb; |
|
|
335 | |
|
|
336 | callback_set (cb, this, vpn, script_if_init); |
334 | if (tap->if_up () && |
337 | if (tap->if_up () && |
335 | !run_script (run_script_cb (this, &vpn::script_if_init), true)) |
338 | !run_script (cb, true)) |
336 | { |
339 | { |
337 | slog (L_ERR, _("interface initialization command '%s' failed, exiting."), |
340 | slog (L_ERR, _("interface initialization command '%s' failed, exiting."), |
338 | tap->if_up ()); |
341 | tap->if_up ()); |
339 | exit (EXIT_FAILURE); |
342 | exit (EXIT_FAILURE); |
340 | } |
343 | } |
341 | |
344 | |
342 | if (!run_script (run_script_cb (this, &vpn::script_if_up), true)) |
345 | callback_set (cb, this, vpn, script_if_up); |
|
|
346 | if (!run_script (cb, true)) |
343 | { |
347 | { |
344 | slog (L_ERR, _("if-up command execution failed, exiting.")); |
348 | slog (L_ERR, _("if-up command execution failed, exiting.")); |
345 | exit (EXIT_FAILURE); |
349 | exit (EXIT_FAILURE); |
346 | } |
350 | } |
347 | |
351 | |