The branch stable/13 has been updated by markj:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=b2c871b1387e8b7561c35ebc46c7bac764196faf

commit b2c871b1387e8b7561c35ebc46c7bac764196faf
Author:     Mark Johnston <[email protected]>
AuthorDate: 2021-05-03 16:42:54 +0000
Commit:     Mark Johnston <[email protected]>
CommitDate: 2021-05-10 13:35:04 +0000

    bhyve: Set SO_REUSEADDR on the gdb stub socket
    
    Reviewed by:    jhb
    Sponsored by:   The FreeBSD Foundation
    Differential Revision:  https://reviews.freebsd.org/D30037
    
    (cherry picked from commit 02e7a6514e63ceca680fade40797280aef1bf55f)
---
 usr.sbin/bhyve/gdb.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/usr.sbin/bhyve/gdb.c b/usr.sbin/bhyve/gdb.c
index b0f0c034b2c7..6ebc8d4fcd54 100644
--- a/usr.sbin/bhyve/gdb.c
+++ b/usr.sbin/bhyve/gdb.c
@@ -1810,7 +1810,7 @@ void
 init_gdb(struct vmctx *_ctx, int sport, bool wait)
 {
        struct sockaddr_in sin;
-       int error, flags, s;
+       int error, flags, optval, s;
 
        debug("==> starting on %d, %swaiting\n", sport, wait ? "" : "not ");
 
@@ -1826,6 +1826,9 @@ init_gdb(struct vmctx *_ctx, int sport, bool wait)
        if (s < 0)
                err(1, "gdb socket create");
 
+       optval = 1;
+       (void)setsockopt(s, SOL_SOCKET, SO_REUSEADDR, &optval, sizeof(optval));
+
        sin.sin_len = sizeof(sin);
        sin.sin_family = AF_INET;
        sin.sin_addr.s_addr = htonl(INADDR_ANY);
_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/dev-commits-src-all
To unsubscribe, send any mail to "[email protected]"

Reply via email to