When using bhyve's gdb stub to debug some changes to the kernel's early
boot code, I frequently hit an error when reconnecting gdb. Set
SO_REUSEADDR to mitigate this, as we do for the VNC server.
Details
Details
Diff Detail
Diff Detail
- Repository
- rG FreeBSD src repository
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
usr.sbin/bhyve/gdb.c | ||
---|---|---|
1849 | Why no check for errors from setsockopt call? |
usr.sbin/bhyve/gdb.c | ||
---|---|---|
1849 | Because failure isn't fatal probably? The VNC code in rfb.c doesn't check for errors either. In practice I don't think SO_REUSEADDR can fail for a TCP socket on FreeBSD. |
usr.sbin/bhyve/gdb.c | ||
---|---|---|
1849 | This was exactly my reasoning. |
usr.sbin/bhyve/gdb.c | ||
---|---|---|
1849 | The man page clearly indicates it can fail, and the one in dbgport.c does check status. |
usr.sbin/bhyve/gdb.c | ||
---|---|---|
1849 | It will only fail for generic reasons, like if s is not a socket or a copyin of the optval fails. |