I, FINALLY, Fixed the bug where netsukuku just crashed in restricted mode, Without restoring /etc/resolv.conf. However! I did this by bypassing fatal(). This is kind of a hack, Netsukuku will probably be able to restore /etc/resolv.conf without this, Once the tunl0 bug is fixed, Thus preventing fatal from being called.

This commit is contained in:
MissValeska 2014-03-10 15:25:53 -07:00
parent c61afcb0db
commit b7f8a6cdb9
2 changed files with 157 additions and 155 deletions

View File

@ -307,13 +307,15 @@ void init_internet_gateway_search(void)
* Bring tunl0 up (just to test if the ipip module is loaded)
*/
loginfo("Configuring the \"" DEFAULT_TUNL_IF "\" tunnel device");
if(tunnel_change(0, 0, 0, DEFAULT_TUNL_PREFIX, DEFAULT_TUNL_NUMBER) < 0)
fatal("Cannot initialize \"" DEFAULT_TUNL_IF "\". "
if(tunnel_change(0, 0, 0, DEFAULT_TUNL_PREFIX, DEFAULT_TUNL_NUMBER) < 0) {
printf("Cannot initialize \"" DEFAULT_TUNL_IF "\". "
"Is the \"ipip\" kernel module loaded?\n"
" If you don't care about using the shared internet "
"connections of the ntk nodes\n"
" around you, disable the \"use_shared_inet\" option "
"in netsukuku.conf");
del_resolv_conf("nameserver 127.0.0.1", "/etc/resolv.conf");
exit(1);}
ifs_del_all_name(me.cur_ifs, &me.cur_ifs_n, NTK_TUNL_PREFIX);
ifs_del_all_name(me.cur_ifs, &me.cur_ifs_n, DEFAULT_TUNL_PREFIX);