testj1939: use send() when connect()ed

When using connect(), don't re-use the peername but use send() without
destination information
pull/66/head
Kurt Van Dijck 2013-11-20 11:19:40 +01:00
parent d66e6ce4ee
commit 854f47fa84
1 changed files with 5 additions and 1 deletions

View File

@ -163,7 +163,11 @@ int main(int argc, char *argv[])
dat[j] = ((2*j) << 4) + ((2*j+1) & 0xf);
/* 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,
(void *)&peername, sizeof(peername));
else