Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

selftests: nettest: Fix typo in log and error messages for clarity

This patch corrects several logging and error message in nettest.c:
- Corrects function name in log messages "setsockopt" -> "getsockopt".
- Closes missing parentheses in "setsockopt(IPV6_FREEBIND)".
- Replaces misleading error text ("Invalid port") with the correct
description ("Invalid prefix length").
- remove Redundant wording like "status from status" and clarifies
context in IPC error messages.

These changes improve readability and aid in debugging test output.

Signed-off-by: Alok Tiwari <alok.a.tiwari@oracle.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://patch.msgid.link/20250615084822.1344759-1-alok.a.tiwari@oracle.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Alok Tiwari and committed by
Jakub Kicinski
416b6030 4b7da734

+6 -6
+6 -6
tools/testing/selftests/net/nettest.c
··· 385 385 name[0] = '\0'; 386 386 rc = getsockopt(sd, SOL_SOCKET, SO_BINDTODEVICE, name, &optlen); 387 387 if (rc < 0) 388 - log_err_errno("setsockopt(SO_BINDTODEVICE)"); 388 + log_err_errno("getsockopt(SO_BINDTODEVICE)"); 389 389 390 390 return rc; 391 391 } ··· 535 535 break; 536 536 case AF_INET6: 537 537 if (setsockopt(sd, SOL_IPV6, IPV6_FREEBIND, &one, sizeof(one))) { 538 - log_err_errno("setsockopt(IPV6_FREEBIND"); 538 + log_err_errno("setsockopt(IPV6_FREEBIND)"); 539 539 rc = -1; 540 540 } 541 541 break; ··· 812 812 sep++; 813 813 if (str_to_uint(sep, 1, pfx_len_max, 814 814 &args->prefix_len) != 0) { 815 - fprintf(stderr, "Invalid port\n"); 815 + fprintf(stderr, "Invalid prefix length\n"); 816 816 return 1; 817 817 } 818 818 } else { ··· 1272 1272 } 1273 1273 } 1274 1274 1275 - nfds = interactive ? MAX(fileno(stdin), sd) + 1 : sd + 1; 1275 + nfds = interactive ? MAX(fileno(stdin), sd) + 1 : sd + 1; 1276 1276 while (1) { 1277 1277 FD_ZERO(&rfds); 1278 1278 FD_SET(sd, &rfds); ··· 1492 1492 sd = socket(args->version, args->type, args->protocol); 1493 1493 if (sd < 0) { 1494 1494 log_err_errno("Error opening socket"); 1495 - return -1; 1495 + return -1; 1496 1496 } 1497 1497 1498 1498 if (set_reuseaddr(sd) != 0) ··· 1912 1912 * waiting to be told when to continue 1913 1913 */ 1914 1914 if (read(fd, &buf, sizeof(buf)) <= 0) { 1915 - log_err_errno("Failed to read IPC status from status"); 1915 + log_err_errno("Failed to read IPC status from pipe"); 1916 1916 return 1; 1917 1917 } 1918 1918 if (!buf) {