diff --git a/src/andns.c b/src/andns.c index 107f81d..ea592df 100644 --- a/src/andns.c +++ b/src/andns.c @@ -955,7 +955,7 @@ andns_rslv(char *msg, int msglen, char *answer, int *answ_len) printf("andns_rslv msg %s answer %s", msg, answer); if(netsplit.netsplit_inet_mode == 1) - inet_mode (msg); + inet_mode(msg); proto = GET_NK_BIT(msg); if (proto == NK_DNS) diff --git a/src/inet.c b/src/inet.c index 3ce3b38..246e388 100644 --- a/src/inet.c +++ b/src/inet.c @@ -1060,10 +1060,10 @@ inet_send(int s, const void *msg, size_t len, int flags) * it will just come back here to repeat the process as needed. */ case EMSGSIZE: inet_send(s, msg, len/2, flags); - err=inet_send(s, (const char *)msg+(len/2), - len-(len/2), flags); + err = inet_send(s, msg+(len/2), (len+1)/2); + + printf("%lu", err); break; - default: error("inet_send: Cannot send(): %s", strerror(errno)); return err; @@ -1113,8 +1113,9 @@ inet_sendto(int s, const void *msg, size_t len, int flags, switch (errno) { case EMSGSIZE: inet_sendto(s, msg, len/2, flags, to, tolen); - err=inet_sendto(s, (const char *)msg+(len/2), - len-(len/2), flags, to, tolen); + err = inet_sendto(s, msg+(len/2), (len+1)/2, flags, to, tolen); + + printf("%lu", err); break; case EFAULT: /* Must be modified to accept IPv6 addresses @@ -1172,5 +1173,23 @@ inet_sendfile(int out_fd, int in_fd, off_t * offset, size_t count) if ((err = sendfile(out_fd, in_fd, offset, count)) == -1) error("inet_sendfile: Cannot sendfile(): %s", strerror(errno)); + if (err < count) { + count = count - err; + err = inet_sendfile(out_fd, in_fd, offset, count); + } + return err; +} + +ssize_t +inet_sendfile64(int out_fd, int in_fd, off64_t * offset, size_t count) +{ + ssize_t err; + + if ((err = sendfile64(out_fd, in_fd, offset, count)) == -1) + error("inet_sendfile: Cannot sendfile(): %s", strerror(errno)); + if (err < count) { + count = count - err; + err = inet_sendfile64(out_fd, in_fd, offset, count); + } return err; } diff --git a/src/inet.h b/src/inet.h index 6c49118..c73a9c7 100644 --- a/src/inet.h +++ b/src/inet.h @@ -209,5 +209,6 @@ ssize_t inet_sendto_timeout(int s, const void *msg, size_t len, int flags, const struct sockaddr *to, socklen_t tolen, u_int timeout); ssize_t inet_sendfile(int out_fd, int in_fd, off_t * offset, size_t count); +ssize_t inet_sendfile64(int out_fd, int in_fd, off64_t * offset, size_t count); #endif /*INET_H */ diff --git a/src/mark.c b/src/mark.c index 66b8407..9548682 100644 --- a/src/mark.c +++ b/src/mark.c @@ -465,7 +465,7 @@ mark_init(int igw) } restore_output_rule_init(rule); - error("Rule in mark_init: %s", rule); + error("Rule in mark_init: %s", *rule); res = insert_rule(rule, &t, CHAIN_OUTPUT, 0); if (res) { diff --git a/src/netsukuku.c b/src/netsukuku.c index 5a3c078..58f3e30 100644 --- a/src/netsukuku.c +++ b/src/netsukuku.c @@ -181,7 +181,7 @@ usage(void) " -k Kills the running instance of ntkd\n" " -C Runs the console server for Ntk-Console to connect to\n" " -e Excludes an interface from usage I.E all interfaces except this one\n" - " -n Experimental argument to implement ntk netsplit\n http://netsukuku.freaknet.org/docs/main_doc/ntk_rfc/Ntk_net_split\n"); + " -n Experimental argument to implement ntk netsplit inet/INET or ntk/NTK\n http://netsukuku.freaknet.org/docs/main_doc/ntk_rfc/Ntk_net_split\n"); } /*