This option is needed for j1939 socket functionality test.
Connects wihout bind should not work.
Signed-off-by: Bastian Stender <bst@pengutronix.de>
Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
This option is needed for j1939 socket functionality test.
Binding to a socket and rebinding to the socket with e.g. a different SA
should work.
Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
Signed-off-by: Bastian Stender <bst@pengutronix.de>
canaddr2str() from testj1939 and libj1939's libj1939_addr2str provide
the same functionality. Remove the local helper function and use
libj1939_addr2str instead.
Signed-off-by: Bastian Stender <bst@pengutronix.de>
testj1939.c: In function 'main':
testj1939.c:201:3: warning: format '%li' expects argument of type 'long int', but argument 4 has type 'unsigned int' [-Wformat=]
fprintf(stderr, "- bind(, %s, %li);\n", canaddr2str(&sockname), sizeof(sockname));
^
testj1939.c:210:4: warning: format '%li' expects argument of type 'long int', but argument 4 has type 'unsigned int' [-Wformat=]
fprintf(stderr, "- connect(, %s, %li);\n", canaddr2str(&peername), sizeof(peername));
^
testj1939.c:228:5: warning: format '%li' expects argument of type 'long int', but argument 5 has type 'unsigned int' [-Wformat=]
fprintf(stderr, "- sendto(, <dat>, %i, 0, %s, %li);\n", todo_send, canaddr2str(&peername), sizeof(peername));
^
testj1939.c:254:4: warning: format '%li' expects argument of type 'long int', but argument 3 has type 'unsigned int' [-Wformat=]
fprintf(stderr, "- recvfrom(, <dat>, %li, 0, &<peername>, %li);\n", sizeof(peername), sizeof(peername));
^
testj1939.c:254:4: warning: format '%li' expects argument of type 'long int', but argument 4 has type 'unsigned int' [-Wformat=]
Use 'z' as correct modifier to print sizeof().
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>