Browse Source

Adding some debug options, And cleaned up spam texts.

MissValeska 9 years ago
parent
commit
4b512c8ef8
2 changed files with 5 additions and 10 deletions
  1. 3
    0
      src/andns.c
  2. 2
    10
      src/inet.c

+ 3
- 0
src/andns.c View File

@@ -199,12 +199,15 @@ andns_init(int restricted, char *resolv_conf, int family)
199 199
 	if (_default_realm_ == NTK_REALM) {
200 200
 		/* We are in NTK realm, every IP is assigned to Netsukuku,
201 201
 		 * therefore dns forwarding is meaningless */
202
+                loginfo("We are in the ntk realm %s\n", strerror(errno));
202 203
 		_dns_forwarding_ = 0;
203 204
 		return 0;
204 205
 	}
205 206
 
206 207
 	res = collect_resolv_conf(resolv_conf);
207 208
 	if (res <= 0) {
209
+                loginfo("Some kind of error occurred in collecting the dns nameservers"
210
+                        " %s\n", strerror(errno));
208 211
 		_dns_forwarding_ = 0;
209 212
 		debug(DBG_NORMAL, err_str);
210 213
 		err_ret(ERR_RSLAIE, -1);

+ 2
- 10
src/inet.c View File

@@ -1062,7 +1062,6 @@ inet_send(int s, const void *msg, size_t len, int flags)
1062 1062
 				inet_send(s, msg, len/2, flags);
1063 1063
 				err=inet_send(s, (const char *)msg+(len/2),
1064 1064
 						len-(len/2), flags);
1065
-                                error("\nEMSGSIZE inet_send testing.\n");
1066 1065
 				break;
1067 1066
 
1068 1067
 			default:
@@ -1110,29 +1109,22 @@ inet_sendto(int s, const void *msg, size_t len, int flags,
1110 1109
 			const struct sockaddr * to, socklen_t tolen)
1111 1110
 {
1112 1111
 	ssize_t err;
1113
-        /* How are these last two arguments used when the function being called
1114
-         * doesn't have those arguments? */
1115 1112
 	if ((err = sendto(s, msg, len, flags, to, tolen)) == -1) {
1116
-		error("sendto errno: %d err is: %d", errno, err);
1113
+		error("sendto: %s err is: %d", strerror(errno), err);
1117 1114
 		switch (errno) {
1118 1115
 		case EMSGSIZE:
1119
-			error("Packet artificially fragmented: %d", stderr);
1120
-			error("\nData Length: %u", len);
1121 1116
 				inet_sendto(s, msg, len/2, flags, to, tolen);
1122 1117
 				err=inet_sendto(s, (const char *)msg+(len/2),
1123 1118
 						len-(len/2), flags, to, tolen);
1124
-                                error("\nsendto error after fragmention is: %d, err is: %d\n", errno, err);
1125 1119
 			break;
1126 1120
 		case EFAULT:
1127
-			error("The value of to is: %d", to);
1121
+			error("The value of to is: %d and %s", to, strerror(errno));
1128 1122
 		default:
1129 1123
 			error("inet_sendto: Cannot send(): %s", strerror(errno));
1130 1124
 			return err;
1131 1125
 			break;
1132 1126
 		}
1133 1127
 
1134
-	error("\nSuccessfully sent packet, errno: %d\n", errno);
1135
-
1136 1128
 	}
1137 1129
 	return err;
1138 1130
 }

Loading…
Cancel
Save