commit d1bafd4403cdd1befcd19458c7265cfb187ebb87 parent 05e6f954a28901e2758fda4bdcab1e245ca41d47 Author: deurzen <m.deurzen@tum.de> Date: Sun, 13 Dec 2020 04:45:39 +0100 refactors code Diffstat:
M | src/sockhide.c | | | 11 | +---------- |
1 file changed, 1 insertion(+), 10 deletions(-)
diff --git a/src/sockhide.c b/src/sockhide.c @@ -114,16 +114,7 @@ find_port_in_list(port_list_t_ptr head, port_t port, proto proto) { port_list_t_ptr i; for (i = head; i; i = i->next) - if (proto == -1) { - if (i->port == port - && (i->proto == tcp4 - || i->proto == udp4 - || i->proto == tcp6 - || i->proto == udp6)) - { - return i; - } - } else if (i->port == port && i->proto == proto) + if (i->port == port && (proto == -1 || i->proto == proto)) return i; return NULL;