Enable slirp IPv6 support by default.

Added slirp config option "ipv6_prefix".
This commit is contained in:
Volker Ruppert 2024-05-23 19:01:40 +02:00
parent 87c3e4be79
commit 9c356c4f2e
3 changed files with 9 additions and 4 deletions

View File

@ -26,7 +26,7 @@ Detailed change log :
- Added PCM playback/recording support using PulseAudio simple API - Added PCM playback/recording support using PulseAudio simple API
- Networking - Networking
- Added support for using libslirp library instead of builtin slirp code - Added support for using libslirp library instead of builtin slirp code
- Updated builtin slirp from libslirp 4.8.0 (including IPv6 support) - Updated builtin slirp based on libslirp 4.8.0 (including IPv6 support)
- BIOS - BIOS
- Added panic in legacy BIOS in case no VGA BIOS ROM is found at C000:0000, - Added panic in legacy BIOS in case no VGA BIOS ROM is found at C000:0000,

View File

@ -17,7 +17,7 @@
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
// //
// eth_slirp.cc - Bochs port of Qemu's slirp implementation (plus libslirp support) // eth_slirp.cc - Bochs port of Qemu's slirp implementation (updated from libslirp 4.8.0)
// Portion of this software comes with the following license: BSD-3-Clause // Portion of this software comes with the following license: BSD-3-Clause
#define BX_PLUGGABLE #define BX_PLUGGABLE
@ -283,6 +283,9 @@ bx_slirp_pktmover_c::bx_slirp_pktmover_c(const char *netif,
config.vnameserver.s_addr = htonl(0x0a000203); /* 10.0.2.3 */ config.vnameserver.s_addr = htonl(0x0a000203); /* 10.0.2.3 */
config.tftp_path = netif; config.tftp_path = netif;
config.vdomainname = "local"; config.vdomainname = "local";
/* enable IPv6 support by default using QEMU settings */
config.in6_enabled = true;
inet_pton(AF_INET6, "fec0::", &config.vprefix_addr6);
#ifndef WIN32 #ifndef WIN32
smb_export = NULL; smb_export = NULL;
smb_tmpdir = NULL; smb_tmpdir = NULL;
@ -317,7 +320,6 @@ bx_slirp_pktmover_c::bx_slirp_pktmover_c(const char *netif,
} }
if (config.in6_enabled) { if (config.in6_enabled) {
BX_INFO(("IPv6 enabled (using default QEMU settings)")); BX_INFO(("IPv6 enabled (using default QEMU settings)"));
inet_pton(AF_INET6, "fec0::", &config.vprefix_addr6);
config.vprefix_len = 64; config.vprefix_len = 64;
config.vhost6 = config.vprefix_addr6; config.vhost6 = config.vprefix_addr6;
config.vhost6.s6_addr[15] |= 2; config.vhost6.s6_addr[15] |= 2;
@ -565,6 +567,8 @@ bool bx_slirp_pktmover_c::parse_slirp_conf(const char *conf)
} }
} else if (!stricmp(param, "ipv6_enabled")) { } else if (!stricmp(param, "ipv6_enabled")) {
config.in6_enabled = (atoi(val) != 0); config.in6_enabled = (atoi(val) != 0);
} else if (!stricmp(param, "ipv6_prefix")) {
inet_pton(AF_INET6, val, &config.vprefix_addr6);
} else if (!stricmp(param, "tftp_srvname")) { } else if (!stricmp(param, "tftp_srvname")) {
if (len2 < 33) { if (len2 < 33) {
config.tftp_server_name = (char*)malloc(len2+1); config.tftp_server_name = (char*)malloc(len2+1);

View File

@ -42,8 +42,9 @@
# Packet logging example # Packet logging example
# pktlog = slirp-pktlog.txt # pktlog = slirp-pktlog.txt
# Enable IPv6 support (using default Qemu setup) # IPv6 support (enabled by default using Qemu settings)
# ipv6_enabled = 1 # ipv6_enabled = 1
# ipv6_prefix = fec0::
# Enable slirp debugging support if > 0 # Enable slirp debugging support if > 0
# The value can be a combination of these debug levels # The value can be a combination of these debug levels