commit a3dc2f5de198c4a5c70d7b2be4db9179531c4456 from: Omar Polo date: Fri Nov 03 15:44:46 2023 UTC gotwebd: remove dead ipproto handling in host() and host_if() ipproto is always -1, so delete the dead code. ok stsp@ commit - 91f3651eacab82fa74052cacf1b8b5fdf9b05267 commit + a3dc2f5de198c4a5c70d7b2be4db9179531c4456 blob - 83c2090733aa8f9c295326ceac9aed5fc1cf7ae4 blob + 2ffbc4d41b854887e7a306cf3a5252c0a9c4dd82 --- gotwebd/parse.y +++ gotwebd/parse.y @@ -100,9 +100,9 @@ int addr_dup_check(struct addresslist *, struct addr const char *, const char *); int add_addr(struct server *, struct address *); int host(const char *, struct server *, - int, in_port_t, const char *, int); + int, in_port_t, const char *); int host_if(const char *, struct server *, - int, in_port_t, const char *, int); + int, in_port_t, const char *); int is_if_in_group(const char *, const char *); typedef struct { @@ -1024,7 +1024,7 @@ getservice(const char *n) int host(const char *s, struct server *new_srv, int max, - in_port_t port, const char *ifname, int ipproto) + in_port_t port, const char *ifname) { struct addrinfo hints, *res0, *res; int error, cnt = 0; @@ -1032,7 +1032,7 @@ host(const char *s, struct server *new_srv, int max, struct sockaddr_in6 *sin6; struct address *h; - if ((cnt = host_if(s, new_srv, max, port, ifname, ipproto)) != 0) + if ((cnt = host_if(s, new_srv, max, port, ifname)) != 0) return (cnt); memset(&hints, 0, sizeof(hints)); @@ -1067,8 +1067,6 @@ host(const char *s, struct server *new_srv, int max, return (-1); } } - if (ipproto != -1) - h->ipproto = ipproto; h->ss.ss_family = res->ai_family; if (res->ai_family == AF_INET) { @@ -1097,7 +1095,7 @@ host(const char *s, struct server *new_srv, int max, int host_if(const char *s, struct server *new_srv, int max, - in_port_t port, const char *ifname, int ipproto) + in_port_t port, const char *ifname) { struct ifaddrs *ifap, *p; struct sockaddr_in *sain; @@ -1133,8 +1131,6 @@ host_if(const char *s, struct server *new_srv, int max return (-1); } } - if (ipproto != -1) - h->ipproto = ipproto; h->ss.ss_family = af; if (af == AF_INET) { @@ -1216,19 +1212,17 @@ int get_addrs(const char *addr, struct server *new_srv, in_port_t port) { if (strcmp("", addr) == 0) { - if (host("127.0.0.1", new_srv, 1, port, "127.0.0.1", - -1) <= 0) { + if (host("127.0.0.1", new_srv, 1, port, "127.0.0.1") <= 0) { yyerror("invalid listen ip: %s", "127.0.0.1"); return (-1); } - if (host("::1", new_srv, 1, port, "::1", -1) <= 0) { + if (host("::1", new_srv, 1, port, "::1") <= 0) { yyerror("invalid listen ip: %s", "::1"); return (-1); } } else { - if (host(addr, new_srv, GOTWEBD_MAXIFACE, port, addr, - -1) <= 0) { + if (host(addr, new_srv, GOTWEBD_MAXIFACE, port, addr) <= 0) { yyerror("invalid listen ip: %s", addr); return (-1); }