Page MenuHomeFreeBSD

so_reuseport_lb_test: Changing the variable type of the optval parameter of the setsockopt function
ClosedPublic

Authored by fernando.valle_eldorado.org.br on Mar 23 2020, 1:23 PM.
Referenced Files
Unknown Object (File)
Sat, Apr 13, 12:52 PM
Unknown Object (File)
Feb 11 2024, 9:04 PM
Unknown Object (File)
Jan 29 2024, 10:14 AM
Unknown Object (File)
Dec 22 2023, 11:54 PM
Unknown Object (File)
Dec 12 2023, 11:14 AM
Unknown Object (File)
Dec 8 2023, 7:09 AM
Unknown Object (File)
Nov 20 2023, 6:33 AM
Unknown Object (File)
Oct 8 2023, 10:32 PM

Details

Summary

The so_reuseport_lb_test fails (bind () failed: Address already in use) on PowerPC64.

Changing the type of variable (size_t -> unsigned int) that will be passed as a parameter for setsockopt the test behaves correctly.

Test Plan

kyua test -k /usr/tests/sys/netinet/Kyuafile so_reuseport_lb_test

Diff Detail

Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 30078
Build 27888: arc lint + arc unit

Event Timeline

tests/sys/netinet/so_reuseport_lb_test.c
111

Sorry, why unsigned ?
setsockopt(2) indirectly suggests that in should be plain int: Most socket-level options utilize an int argument for optval.

tests/sys/netinet/so_reuseport_lb_test.c
111

Yes, I read this on the manpage... but I thought of changing the type to the most corresponding one possible, according to the unix specifications size_t is an unsigned integral type.

tests/sys/netinet/so_reuseport_lb_test.c
111

Kernel reads the value as int, which is consistent with the manpage.

Would it be possible to reflect it here?

Following @melifaro `s recommendations, type of variable changed to int, instead of unsigned int.

This revision is now accepted and ready to land.Mar 24 2020, 12:50 PM