keepalived-1.2.2-bind-afunspec.patch 534 B

12345678910111213
  1. diff --git a/keepalived/core/layer4.c b/keepalived/core/layer4.c
  2. index 5725500..5b33417 100644
  3. --- a/keepalived/core/layer4.c
  4. +++ b/keepalived/core/layer4.c
  5. @@ -43,7 +43,7 @@ tcp_bind_connect(int fd, struct sockaddr_storage *addr, struct sockaddr_storage
  6. fcntl(fd, F_SETFL, val | O_NONBLOCK);
  7. /* Bind socket */
  8. - if (bind_addr) {
  9. + if (bind_addr && ((struct sockaddr *) bind_addr)->sa_family != AF_UNSPEC) {
  10. addrlen = sizeof(*bind_addr);
  11. if (bind(fd, (struct sockaddr *) bind_addr, addrlen) != 0)
  12. return connect_error;