Search
j0ke.net Open Build Service
>
Projects
>
ha
>
keepalived-ipv6
> keepalived-bind.patch
Sign Up
|
Log In
Username
Password
Cancel
Overview
Repositories
Revisions
Requests
Users
Advanced
Attributes
Meta
File keepalived-bind.patch of Package keepalived-ipv6 (Revision 25)
Currently displaying revision
25
,
show latest
From 794273c2729f4b79ddd321d3fa90f9b300e86800 Mon Sep 17 00:00:00 2001 From: Vincent Bernat <bernat@luffy.cx> Date: Mon, 05 Dec 2011 13:47:14 +0000 Subject: Don't use bind() with AF_UNSPEC tcp_bind_connect() may be called with a non NULL bind_addr variable but filled with 0. This cause bind() to be called with AF_UNSPEC and make it fail with recent kernels. --- diff --git a/keepalived/core/layer4.c b/keepalived/core/layer4.c index 5725500..5b33417 100644 --- a/keepalived/core/layer4.c +++ b/keepalived/core/layer4.c @@ -43,7 +43,7 @@ tcp_bind_connect(int fd, struct sockaddr_storage *addr, struct sockaddr_storage fcntl(fd, F_SETFL, val | O_NONBLOCK); /* Bind socket */ - if (bind_addr) { + if (bind_addr && ((struct sockaddr *) bind_addr)->sa_family != AF_UNSPEC) { addrlen = sizeof(*bind_addr); if (bind(fd, (struct sockaddr *) bind_addr, addrlen) != 0) return connect_error; -- cgit v0.8.3.4