@@ -363,20 +363,20 @@ func (h *htrun) init(config *cmn.Config) {
363363
364364 // PubNet enable tracing when configuration is set.
365365 muxers := newMuxers (tracing .IsEnabled ())
366- g .netServ .pub = & netServer {muxers : muxers , sndRcvBufSize : tcpbuf }
366+ g .netServ .pub = & netServer {muxers : muxers , sndRcvBufSize : tcpbuf , useIPv6 : config . Net . UseIPv6 }
367367 g .netServ .control = g .netServ .pub // if not separately configured, intra-control net is public
368368 if config .HostNet .UseIntraControl {
369369 // TODO: for now tracing is always disabled for intra-cluster traffic.
370370 // Allow enabling through config.
371371 muxers = newMuxers (false /*enableTracing*/ )
372- g .netServ .control = & netServer {muxers : muxers , sndRcvBufSize : 0 , lowLatencyToS : true }
372+ g .netServ .control = & netServer {muxers : muxers , sndRcvBufSize : 0 , lowLatencyToS : true , useIPv6 : config . Net . UseIPv6 }
373373 }
374374 g .netServ .data = g .netServ .control // if not configured, intra-data net is intra-control
375375 if config .HostNet .UseIntraData {
376376 // TODO: for now tracing is always disabled for intra-data traffic.
377377 // Allow enabling through config.
378378 muxers = newMuxers (false /*enableTracing*/ )
379- g .netServ .data = & netServer {muxers : muxers , sndRcvBufSize : tcpbuf }
379+ g .netServ .data = & netServer {muxers : muxers , sndRcvBufSize : tcpbuf , useIPv6 : config . Net . UseIPv6 }
380380 }
381381
382382 h .owner .smap = newSmapOwner (config )
@@ -402,7 +402,7 @@ func (h *htrun) initSnode(config *cmn.Config) {
402402 port = strconv .Itoa (config .HostNet .Port )
403403 proto = config .Net .HTTP .Proto
404404 )
405- addrList , err := getLocalIPv4s (config )
405+ addrList , err := getLocalIPs (config )
406406 if err != nil {
407407 cos .ExitLogf ("failed to get local IP addr list: %v" , err )
408408 }
@@ -428,8 +428,8 @@ func (h *htrun) initSnode(config *cmn.Config) {
428428 // public hostname could be a load balancer's external IP or a service DNS
429429 nlog .Infoln ("K8s deployment: skipping hostname validation for" , config .HostNet .Hostname )
430430 pubAddr .Init (proto , pub , port )
431- } else if err = initNetInfo (& pubAddr , addrList , proto , config .HostNet .Hostname , port ); err != nil {
432- cos .ExitLogf ("failed to get %s IPv4 /hostname: %v" , cmn .NetPublic , err )
431+ } else if err = initNetInfo (& pubAddr , addrList , proto , config .HostNet .Hostname , port , config . Net . UseIPv6 ); err != nil {
432+ cos .ExitLogf ("failed to select %s IP /hostname: %v" , cmn .NetPublic , err )
433433 }
434434
435435 // multi-home (when config.HostNet.Hostname is a comma-separated list)
@@ -452,9 +452,9 @@ func (h *htrun) initSnode(config *cmn.Config) {
452452 ctrlAddr = pubAddr
453453 if config .HostNet .UseIntraControl {
454454 icport := strconv .Itoa (config .HostNet .PortIntraControl )
455- err = initNetInfo (& ctrlAddr , addrList , proto , config .HostNet .HostnameIntraControl , icport )
455+ err = initNetInfo (& ctrlAddr , addrList , proto , config .HostNet .HostnameIntraControl , icport , config . Net . UseIPv6 )
456456 if err != nil {
457- cos .ExitLogf ("failed to get %s IPv4 /hostname: %v" , cmn .NetIntraControl , err )
457+ cos .ExitLogf ("failed to select %s IP /hostname: %v" , cmn .NetIntraControl , err )
458458 }
459459 var s string
460460 if config .HostNet .HostnameIntraControl != "" {
@@ -465,9 +465,9 @@ func (h *htrun) initSnode(config *cmn.Config) {
465465 dataAddr = pubAddr
466466 if config .HostNet .UseIntraData {
467467 idport := strconv .Itoa (config .HostNet .PortIntraData )
468- err = initNetInfo (& dataAddr , addrList , proto , config .HostNet .HostnameIntraData , idport )
468+ err = initNetInfo (& dataAddr , addrList , proto , config .HostNet .HostnameIntraData , idport , config . Net . UseIPv6 )
469469 if err != nil {
470- cos .ExitLogf ("failed to get %s IPv4 /hostname: %v" , cmn .NetIntraData , err )
470+ cos .ExitLogf ("failed to select %s IP /hostname: %v" , cmn .NetIntraData , err )
471471 }
472472 var s string
473473 if config .HostNet .HostnameIntraData != "" {
@@ -628,7 +628,7 @@ func (h *htrun) run(config *cmn.Config) error {
628628 } else if len (h .si .PubExtra ) > 0 {
629629 for _ , pubExtra := range h .si .PubExtra {
630630 debug .Assert (pubExtra .Port == h .si .PubNet .Port , "expecting the same TCP port for all multi-home interfaces" )
631- server := & netServer {muxers : g .netServ .pub .muxers , sndRcvBufSize : g .netServ .pub .sndRcvBufSize }
631+ server := & netServer {muxers : g .netServ .pub .muxers , sndRcvBufSize : g .netServ .pub .sndRcvBufSize , useIPv6 : config . Net . UseIPv6 }
632632 go func () {
633633 _ = server .listen (pubExtra .TCPEndpoint (), logger , tlsConf , config )
634634 }()
0 commit comments