mirror of
https://github.com/ChronosX88/netsukuku.git
synced 2024-11-22 18:22:18 +00:00
A million changes, tunl0 was only ever used for checking if the ipip module is loaded. So, Instead of trying to modify it to check if it exists, We now just use get tunnel. We improved some errors and added some of our own. We made more changes than I can remember right now, Please enjoy.
This commit is contained in:
parent
415d789b80
commit
b28ac22fb3
@ -306,16 +306,16 @@ 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");
|
||||
loginfo("Checking if \"" DEFAULT_TUNL_IF "\" exists");
|
||||
if(tunnel_change(0, 0, 0, DEFAULT_TUNL_PREFIX, DEFAULT_TUNL_NUMBER) < 0) {
|
||||
printf("Cannot initialize \"" DEFAULT_TUNL_IF "\". "
|
||||
printf("Cannot read \"" 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);
|
||||
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);
|
||||
|
@ -1055,6 +1055,7 @@ ssize_t inet_sendto(int s, const void *msg, size_t len, int flags,
|
||||
int ret;
|
||||
|
||||
if((err=sendto(s, msg, len, flags, to, tolen))==-1) {
|
||||
error("sendto errno: %d err is: %d", errno, err);
|
||||
switch(errno)
|
||||
{
|
||||
case EMSGSIZE:
|
||||
|
@ -56,8 +56,7 @@ int tunnel_add(inet_prefix *remote, inet_prefix *local, char *dev,
|
||||
int tunnel_change(inet_prefix *remote, inet_prefix *local, char *dev,
|
||||
char *tunl_prefix, int tunl_number)
|
||||
{
|
||||
error("The value of siocchgtunnel is: %d", SIOCCHGTUNNEL);
|
||||
return do_add(SIOCCHGTUNNEL, remote, local, dev, tunl_prefix,
|
||||
return do_add(SIOCGETTUNNEL, remote, local, dev, tunl_prefix,
|
||||
tunl_number);
|
||||
}
|
||||
|
||||
@ -248,7 +247,6 @@ int do_get(char *dev)
|
||||
static int do_add(int cmd, inet_prefix *remote, inet_prefix *local, char *dev,
|
||||
char *tunl_prefix, int tunl_number)
|
||||
{
|
||||
error("This is the do_add function.");
|
||||
struct ip_tunnel_parm p;
|
||||
|
||||
if (fill_tunnel_parm(cmd, remote, local, dev, tunl_prefix,
|
||||
|
@ -22,8 +22,8 @@
|
||||
#include "if.h"
|
||||
|
||||
#define DEFAULT_TUNL_PREFIX "tunl"
|
||||
#define DEFAULT_TUNL_NUMBER 1 /* The permanent tunl0 device */
|
||||
#define DEFAULT_TUNL_IF "tunl1"
|
||||
#define DEFAULT_TUNL_NUMBER 0 /* The permanent tunl0 device */
|
||||
#define DEFAULT_TUNL_IF "tunl0"
|
||||
#define NTK_TUNL_PREFIX "ntk_tunl"
|
||||
|
||||
/* Usage: printf(TUNL_STRING, TUNL_NUMBER("tunl", x)); */
|
||||
|
@ -105,7 +105,7 @@ int commit_rules(iptc_handle_t *t)
|
||||
{
|
||||
int res;
|
||||
res=iptc_commit(t);
|
||||
error("This is the value of res: %i This is the value of t is: %s", res, t);
|
||||
error("This is the value of res: %i This is the value of t is: %p", res, t);
|
||||
if (!res) {
|
||||
error("In commit_rules: %s.",iptc_strerror(errno));
|
||||
err_ret(ERR_NETCOM,-1);
|
||||
|
Loading…
Reference in New Issue
Block a user