diff options
author | Andrew Tridgell <tridge@samba.org> | 2007-05-15 09:42:52 +1000 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2007-05-15 09:42:52 +1000 |
commit | 7d3870d41f60702944e7e7ecb84b00e61335e139 (patch) | |
tree | 8b6249837bdbbb3905bb2b562d466c166c974047 /ctdb/tcp/tcp_connect.c | |
parent | 3f3eb4f63686ff8de94a1e6927b4413795c11d48 (diff) | |
download | samba-7d3870d41f60702944e7e7ecb84b00e61335e139.tar.gz samba-7d3870d41f60702944e7e7ecb84b00e61335e139.tar.xz samba-7d3870d41f60702944e7e7ecb84b00e61335e139.zip |
AIX needs sin_len field for bind()
(This used to be ctdb commit cd6c35d4aa4f4a4cfeedf6902cda84e43d7aeba4)
Diffstat (limited to 'ctdb/tcp/tcp_connect.c')
-rw-r--r-- | ctdb/tcp/tcp_connect.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/ctdb/tcp/tcp_connect.c b/ctdb/tcp/tcp_connect.c index d5c943bc42..ac82e4f575 100644 --- a/ctdb/tcp/tcp_connect.c +++ b/ctdb/tcp/tcp_connect.c @@ -125,6 +125,10 @@ void ctdb_tcp_node_connect(struct event_context *ev, struct timed_event *te, set_nonblocking(tnode->fd); + ZERO_STRUCT(sock_out); +#ifdef HAVE_SOCK_SIN_LEN + sock_out.sin_len = sizeof(sock_out); +#endif if (ctdb_tcp_get_address(ctdb, node->address.address, &sock_out.sin_addr) != 0) { return; } @@ -138,6 +142,10 @@ void ctdb_tcp_node_connect(struct event_context *ev, struct timed_event *te, * the remote side is actually routable in case CTDB traffic will run on * a dedicated non-routeable network. */ + ZERO_STRUCT(sock_in); +#ifdef HAVE_SOCK_SIN_LEN + sock_in.sin_len = sizeof(sock_in); +#endif if (ctdb_tcp_get_address(ctdb, ctdb->address.address, &sock_in.sin_addr) != 0) { return; } @@ -239,6 +247,10 @@ static int ctdb_tcp_listen_automatic(struct ctdb_context *ctdb) } for (i=0;i<ctdb->num_nodes;i++) { + ZERO_STRUCT(sock); +#ifdef HAVE_SOCK_SIN_LEN + sock.sin_len = sizeof(sock); +#endif sock.sin_port = htons(ctdb->nodes[i]->address.port); sock.sin_family = PF_INET; if (ctdb_tcp_get_address(ctdb, ctdb->nodes[i]->address.address, @@ -309,6 +321,10 @@ int ctdb_tcp_listen(struct ctdb_context *ctdb) return ctdb_tcp_listen_automatic(ctdb); } + ZERO_STRUCT(sock); +#ifdef HAVE_SOCK_SIN_LEN + sock.sin_len = sizeof(sock); +#endif sock.sin_port = htons(ctdb->address.port); sock.sin_family = PF_INET; |