X-Git-Url: https://git.librecmc.org/?p=oweals%2Ftinc.git;a=blobdiff_plain;f=src%2Fnet_setup.c;h=4b90737f3c68d4e8d43baf473e110f27ab2c4bf8;hp=2684514392dac017d4b3faeba8f8b4aa510bce69;hb=c373de2e9812700c0568640727ad917b6fc7d758;hpb=9dea33f5301119dd4423eb962956cf2d246af3f3 diff --git a/src/net_setup.c b/src/net_setup.c index 2684514..4b90737 100644 --- a/src/net_setup.c +++ b/src/net_setup.c @@ -548,6 +548,8 @@ static bool setup_myself(void) { devops = dummy_devops; else if(!strcasecmp(type, "raw_socket")) devops = raw_socket_devops; + else if(!strcasecmp(type, "multicast")) + devops = multicast_devops; #ifdef ENABLE_UML else if(!strcasecmp(type, "uml")) devops = uml_devops; @@ -587,12 +589,25 @@ static bool setup_myself(void) { if(cfg) cfg = lookup_config_next(config_tree, cfg); + char *port = myport; + + if(address) { + char *space = strchr(address, ' '); + if(space) { + *space++ = 0; + port = space; + } + + if(!strcmp(address, "*")) + *address = 0; + } + hint.ai_family = addressfamily; hint.ai_socktype = SOCK_STREAM; hint.ai_protocol = IPPROTO_TCP; hint.ai_flags = AI_PASSIVE; - err = getaddrinfo(address, myport, &hint, &ai); + err = getaddrinfo(address && *address ? address : NULL, port, &hint, &ai); free(address); if(err || !ai) {