testj1939: use send() when connect()ed

When using connect(), don't re-use the peername but use send() without
destination information
This commit is contained in:
Kurt Van Dijck
2013-11-20 11:21:07 +01:00
parent d66e6ce4ee
commit 854f47fa84
+5 -1
View File
@@ -163,7 +163,11 @@ int main(int argc, char *argv[])
dat[j] = ((2*j) << 4) + ((2*j+1) & 0xf); dat[j] = ((2*j) << 4) + ((2*j+1) & 0xf);
/* send data */ /* send data */
if (valid_peername) /*
* when using connect, do not provide additional
* destination information and use send()
*/
if (valid_peername && !todo_connect)
ret = sendto(sock, dat, todo_send, 0, ret = sendto(sock, dat, todo_send, 0,
(void *)&peername, sizeof(peername)); (void *)&peername, sizeof(peername));
else else