From 22a50ad085e35bb2edd49ac51c0e45b05c0e27bf Mon Sep 17 00:00:00 2001 From: Jonathan Moody <103143855+moodyjon@users.noreply.github.com> Date: Tue, 22 Nov 2022 13:27:40 -0600 Subject: [PATCH] Limit session-based JSON RPC service to IPv4. Client not ready for IPv6. --- server/jsonrpc_service.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/server/jsonrpc_service.go b/server/jsonrpc_service.go index 4e1f610..b846c00 100644 --- a/server/jsonrpc_service.go +++ b/server/jsonrpc_service.go @@ -54,13 +54,13 @@ func (cr *gorillaRpcCodecRequest) Method() (string, error) { func (s *Server) StartJsonRPC() error { // Set up the pure JSONRPC server with persistent connections/sessions. if s.Args.JSONRPCPort != 0 { - port := ":" + strconv.FormatUint(uint64(s.Args.JSONRPCPort), 10) - laddr, err := net.ResolveTCPAddr("tcp", port) + port := ":" + strconv.Itoa(s.Args.JSONRPCPort) + laddr, err := net.ResolveTCPAddr("tcp4", port) if err != nil { log.Errorf("ResoveIPAddr: %v\n", err) goto fail1 } - listener, err := net.ListenTCP("tcp", laddr) + listener, err := net.ListenTCP("tcp4", laddr) if err != nil { log.Errorf("ListenTCP: %v\n", err) goto fail1