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)
Fri, Jan 24, 7:54 PM
Unknown Object (File)
Fri, Jan 17, 12:55 AM
Unknown Object (File)
Dec 11 2024, 4:19 AM
Unknown Object (File)
Oct 9 2024, 2:30 AM
Unknown Object (File)
Oct 5 2024, 2:03 PM
Unknown Object (File)
Oct 4 2024, 12:44 PM
Unknown Object (File)
Oct 2 2024, 2:15 AM
Unknown Object (File)
Oct 1 2024, 9:25 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

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

tests/sys/netinet/so_reuseport_lb_test.c
111 ↗(On Diff #69731)

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 ↗(On Diff #69731)

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 ↗(On Diff #69731)

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