mirror of
https://github.com/ChronosX88/netsukuku.git
synced 2024-11-26 04:02:19 +00:00
Adding some debug options, And cleaned up spam texts.
This commit is contained in:
parent
738f6cf903
commit
4b512c8ef8
@ -199,12 +199,15 @@ andns_init(int restricted, char *resolv_conf, int family)
|
|||||||
if (_default_realm_ == NTK_REALM) {
|
if (_default_realm_ == NTK_REALM) {
|
||||||
/* We are in NTK realm, every IP is assigned to Netsukuku,
|
/* We are in NTK realm, every IP is assigned to Netsukuku,
|
||||||
* therefore dns forwarding is meaningless */
|
* therefore dns forwarding is meaningless */
|
||||||
|
loginfo("We are in the ntk realm %s\n", strerror(errno));
|
||||||
_dns_forwarding_ = 0;
|
_dns_forwarding_ = 0;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
res = collect_resolv_conf(resolv_conf);
|
res = collect_resolv_conf(resolv_conf);
|
||||||
if (res <= 0) {
|
if (res <= 0) {
|
||||||
|
loginfo("Some kind of error occurred in collecting the dns nameservers"
|
||||||
|
" %s\n", strerror(errno));
|
||||||
_dns_forwarding_ = 0;
|
_dns_forwarding_ = 0;
|
||||||
debug(DBG_NORMAL, err_str);
|
debug(DBG_NORMAL, err_str);
|
||||||
err_ret(ERR_RSLAIE, -1);
|
err_ret(ERR_RSLAIE, -1);
|
||||||
|
12
src/inet.c
12
src/inet.c
@ -1062,7 +1062,6 @@ inet_send(int s, const void *msg, size_t len, int flags)
|
|||||||
inet_send(s, msg, len/2, flags);
|
inet_send(s, msg, len/2, flags);
|
||||||
err=inet_send(s, (const char *)msg+(len/2),
|
err=inet_send(s, (const char *)msg+(len/2),
|
||||||
len-(len/2), flags);
|
len-(len/2), flags);
|
||||||
error("\nEMSGSIZE inet_send testing.\n");
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
@ -1110,29 +1109,22 @@ inet_sendto(int s, const void *msg, size_t len, int flags,
|
|||||||
const struct sockaddr * to, socklen_t tolen)
|
const struct sockaddr * to, socklen_t tolen)
|
||||||
{
|
{
|
||||||
ssize_t err;
|
ssize_t err;
|
||||||
/* How are these last two arguments used when the function being called
|
|
||||||
* doesn't have those arguments? */
|
|
||||||
if ((err = sendto(s, msg, len, flags, to, tolen)) == -1) {
|
if ((err = sendto(s, msg, len, flags, to, tolen)) == -1) {
|
||||||
error("sendto errno: %d err is: %d", errno, err);
|
error("sendto: %s err is: %d", strerror(errno), err);
|
||||||
switch (errno) {
|
switch (errno) {
|
||||||
case EMSGSIZE:
|
case EMSGSIZE:
|
||||||
error("Packet artificially fragmented: %d", stderr);
|
|
||||||
error("\nData Length: %u", len);
|
|
||||||
inet_sendto(s, msg, len/2, flags, to, tolen);
|
inet_sendto(s, msg, len/2, flags, to, tolen);
|
||||||
err=inet_sendto(s, (const char *)msg+(len/2),
|
err=inet_sendto(s, (const char *)msg+(len/2),
|
||||||
len-(len/2), flags, to, tolen);
|
len-(len/2), flags, to, tolen);
|
||||||
error("\nsendto error after fragmention is: %d, err is: %d\n", errno, err);
|
|
||||||
break;
|
break;
|
||||||
case EFAULT:
|
case EFAULT:
|
||||||
error("The value of to is: %d", to);
|
error("The value of to is: %d and %s", to, strerror(errno));
|
||||||
default:
|
default:
|
||||||
error("inet_sendto: Cannot send(): %s", strerror(errno));
|
error("inet_sendto: Cannot send(): %s", strerror(errno));
|
||||||
return err;
|
return err;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
error("\nSuccessfully sent packet, errno: %d\n", errno);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user