Parcourir la source

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.

MissValeska il y a 9 ans
Parent
révision
738f6cf903
1 fichiers modifiés avec 3 ajouts et 3 suppressions
  1. 3
    3
      src/inet.c

+ 3
- 3
src/inet.c Voir le fichier

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

Loading…
Annuler
Enregistrer