I just noticed that inet_sendto does NOT call inet_send as I previously assumed, It calls sendto itself. I guess I didn't see that it didn't have inet_ before it. I, Also, Realised that this means that the fragmentation code I copied from inet_send won't work because it calls inet_send instead of inet_sendto. I, Also, Realised that, I need to add the inet_sendto arguments as well. This should fix the cannot send(): Destination address required errors.

This commit is contained in:
MissValeska 2014-10-21 02:31:41 -07:00
parent ae7fc0ee70
commit 738f6cf903

View File

@ -1118,9 +1118,9 @@ inet_sendto(int s, const void *msg, size_t len, int flags,
case EMSGSIZE:
error("Packet artificially fragmented: %d", stderr);
error("\nData Length: %u", len);
inet_send(s, msg, len/2, flags);
err=inet_send(s, (const char *)msg+(len/2),
len-(len/2), flags);
inet_sendto(s, msg, len/2, flags, to, tolen);
err=inet_sendto(s, (const char *)msg+(len/2),
len-(len/2), flags, to, tolen);
error("\nsendto error after fragmention is: %d, err is: %d\n", errno, err);
break;
case EFAULT: