URL: <http://gna.org/bugs/?14106>
Summary: civserver should use --bind= address when connecting to the metaserver, too Project: Freeciv Submitted by: None Submitted on: Tuesday 08/11/2009 at 19:26 CEST Category: None Severity: 2 - Minor Priority: 5 - Normal Status: None Assigned to: None Originator Email: oneing...@gmail.com Open/Closed: Open Discussion Lock: Any Release: Operating System: None _______________________________________________________ Details: Currently, civserver has an option to bind () on a certain IP address. This option is, however, useless for my multihomed system, as it still tries to connect to the metaserver from the other IP, resulting in a non-working metaserver list entry. Alternatively, a separate option (e. g.: --meta-bind=) could be added. ... Perhaps, the change is something like adding the bits like the following ones of sernet.c (server_open_socket): 952 if (!net_lookup_service(srvarg.bind_addr, srvarg.port, &src, FALSE)) { 953 freelog(LOG_FATAL, _("Server: bad address: <%s:%d>."), 954 srvarg.bind_addr, srvarg.port); 955 exit(EXIT_FAILURE); 956 } 999 if(bind(sock, &src.saddr, sockaddr_size(&src)) == -1) { 1000 freelog(LOG_FATAL, "Server bind failed: %s", fc_strerror(fc_get_errno())); 1001 sockaddr_debug(&src); 1002 exit(EXIT_FAILURE); 1003 } ... to meta.c (send_to_metaserver), in between the calls to socket () and fc_connect (): 217 if ((sock = socket(meta_addr.saddr.sa_family, SOCK_STREAM, 0)) == -1) { 218 freelog(LOG_ERROR, "Metaserver: can't open stream socket: %s", 219 fc_strerror(fc_get_errno())); 220 metaserver_failed(); 221 return FALSE; 222 } 223 224 if (fc_connect(sock, &meta_addr.saddr, 225 sockaddr_size(&meta_addr)) == -1) { 226 freelog(LOG_ERROR, "Metaserver: connect failed: %s", fc_strerror(fc_get_errno())); 227 metaserver_failed(); 228 fc_closesocket(sock); 229 return FALSE; 230 } Hopefully I'd be able to do the change and try it soon. TIA. _______________________________________________________ Reply to this item at: <http://gna.org/bugs/?14106> _______________________________________________ Message sent via/by Gna! http://gna.org/ _______________________________________________ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev