Samuel Thibault, le dim. 28 févr. 2021 22:39:57 +0100, a ecrit: > It was simpler to have e.g. udp_listen and udp6_listen separate to keep > uint32_t / in6_addr parameters, but there is no strict reason for this: > the haddr is only passed to the bind() call, and the laddr is only > recorded in the so. Put another way, a refactoring patch could be to > just hand udp_listen two sockaddrs, and it will just work fine.
I have submitted that part to https://gitlab.freedesktop.org/slirp/libslirp/-/merge_requests/74 Could you review it? > We'd then introduce a slirp_add_xhostfwd that takes two sockaddr > instead of host/port. That should then be easy to introduce indeed, and immediately more powerful than the slirp_add/remove_ipv6_hostfwd. Possibly you could just replace in qemu the existing slirp_add/remove_hostfwd call, and thus make the whole code simpler: ideally it's the address parsing function that would produce a sockaddr. Samuel