Commit ffd48dca authored by Aurelio Colosimo's avatar Aurelio Colosimo

arch-gnu-linux and arch-bare: call pp_open_globals after pp_parse_cmdline

pp_open_globals must be called after pp_parse_cmdline; ppg->rt_opts is thus
set explicitly before pp_parse_cmdline, since this parsing affect rt_opts.
Signed-off-by: Aurelio Colosimo's avatarAurelio Colosimo <aurelio@aureliocolosimo.it>
parent 2f92a669
...@@ -69,6 +69,8 @@ int main(int argc, char **argv) ...@@ -69,6 +69,8 @@ int main(int argc, char **argv)
close(conf_fd); close(conf_fd);
} }
ppg->rt_opts = &default_rt_opts;
if ((ret = pp_parse_conf(ppg, conf_buf, conf_len)) < 0) { if ((ret = pp_parse_conf(ppg, conf_buf, conf_len)) < 0) {
pp_printf("Fatal: Error in %s file at line %d\n", CONF_PATH, -ret); pp_printf("Fatal: Error in %s file at line %d\n", CONF_PATH, -ret);
exit(__LINE__); exit(__LINE__);
...@@ -115,11 +117,11 @@ int main(int argc, char **argv) ...@@ -115,11 +117,11 @@ int main(int argc, char **argv)
exit(__LINE__); exit(__LINE__);
} }
pp_open_globals(ppg);
if (pp_parse_cmdline(ppg, argc, argv) != 0) if (pp_parse_cmdline(ppg, argc, argv) != 0)
return -1; return -1;
pp_open_globals(ppg);
posix_main_loop(ppg); posix_main_loop(ppg);
return 0; /* never reached */ return 0; /* never reached */
} }
...@@ -52,12 +52,14 @@ int ppsi_main(int argc, char **argv) ...@@ -52,12 +52,14 @@ int ppsi_main(int argc, char **argv)
ppi->ethernet_mode = PP_DEFAULT_ETHERNET_MODE; ppi->ethernet_mode = PP_DEFAULT_ETHERNET_MODE;
ppi->iface_name = "eth0"; ppi->iface_name = "eth0";
/* This just llocates the stuff */ ppg->rt_opts = &default_rt_opts;
pp_open_globals(ppg);
if (pp_parse_cmdline(ppg, argc, argv) != 0) if (pp_parse_cmdline(ppg, argc, argv) != 0)
return -1; return -1;
/* This just allocates the stuff */
pp_open_globals(ppg);
/* The actual sockets are opened in state-initializing */ /* The actual sockets are opened in state-initializing */
bare_main_loop(ppi); bare_main_loop(ppi);
return 0; return 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