]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
* recent change for pause/play mode broke compilation due to sockaddr_storage.
authorwilly tarreau <willy@wtap.(none)>
Sun, 29 Jan 2006 20:55:30 +0000 (21:55 +0100)
committerwilly tarreau <willy@wtap.(none)>
Sun, 29 Jan 2006 20:55:30 +0000 (21:55 +0100)
haproxy.c

index 1c9dde1edfa8b8683802ed33b9ec8222265fdd95..27a1cc94229c9c65ac181ba4e2b9565218d9b171 100644 (file)
--- a/haproxy.c
+++ b/haproxy.c
@@ -5822,10 +5822,17 @@ static void listen_proxies(void) {
                    else
                        p->state = PR_STIDLE;
                } else {
+                   int port;
+
+                   if (l->addr.ss_family == AF_INET6)
+                       port = ntohs(((struct sockaddr_in6 *)(&l->addr))->sin6_port);
+                   else
+                       port = ntohs(((struct sockaddr_in *)(&l->addr))->sin_port);
+
                    Warning("Port %d busy while trying to enable proxy %s.\n",
-                           ntohs(l->addr.sin_port), p->id);
+                           port, p->id);
                    send_log(p, LOG_WARNING, "Port %d busy while trying to enable proxy %s.\n",
-                            ntohs(l->addr.sin_port), p->id);
+                            port, p->id);
                    /* Another port might have been enabled. Let's stop everything. */
                    pause_proxy(p);
                    break;