From: Christopher Faulet Date: Fri, 22 Oct 2021 13:32:48 +0000 (+0200) Subject: CLEANUP: tools: Use const address for get_net_port() and get_host_port() X-Git-Tag: v2.5-dev12~59 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=99163b75ec5ab831386141b64510b041fa023579;p=thirdparty%2Fhaproxy.git CLEANUP: tools: Use const address for get_net_port() and get_host_port() These functions only extract the port from an address. There is no reason to not use a const address. --- diff --git a/include/haproxy/tools.h b/include/haproxy/tools.h index b6efd72f2a..87ccb31aaa 100644 --- a/include/haproxy/tools.h +++ b/include/haproxy/tools.h @@ -673,7 +673,7 @@ static inline int is_addr(const struct sockaddr_storage *addr) } /* returns port in network byte order */ -static inline int get_net_port(struct sockaddr_storage *addr) +static inline int get_net_port(const struct sockaddr_storage *addr) { switch (addr->ss_family) { case AF_INET: @@ -685,7 +685,7 @@ static inline int get_net_port(struct sockaddr_storage *addr) } /* returns port in host byte order */ -static inline int get_host_port(struct sockaddr_storage *addr) +static inline int get_host_port(const struct sockaddr_storage *addr) { switch (addr->ss_family) { case AF_INET: