mirror of
https://github.com/linux-can/can-utils.git
synced 2026-08-05 06:20:00 +02:00
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:
+5
-1
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user