Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 46915
b: refs/heads/master
c: ab81afd
h: refs/heads/master
i:
  46913: 27e1671
  46911: 668e557
v: v3
  • Loading branch information
Sunil Mushran authored and Mark Fasheh committed Feb 7, 2007
1 parent a96b05e commit 13f6ab2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 3b8118cffad224415c6f6f35abe7ca2a1d79c05a
refs/heads/master: ab81afd30bc154bb1e8749e5aeeffe9b93c90834
15 changes: 8 additions & 7 deletions trunk/fs/ocfs2/cluster/tcp.c
Original file line number Diff line number Diff line change
Expand Up @@ -1805,13 +1805,13 @@ static void o2net_listen_data_ready(struct sock *sk, int bytes)
ready(sk, bytes);
}

static int o2net_open_listening_sock(__be16 port)
static int o2net_open_listening_sock(__be32 addr, __be16 port)
{
struct socket *sock = NULL;
int ret;
struct sockaddr_in sin = {
.sin_family = PF_INET,
.sin_addr = { .s_addr = (__force u32)htonl(INADDR_ANY) },
.sin_addr = { .s_addr = (__force u32)addr },
.sin_port = (__force u16)port,
};

Expand All @@ -1834,15 +1834,15 @@ static int o2net_open_listening_sock(__be16 port)
sock->sk->sk_reuse = 1;
ret = sock->ops->bind(sock, (struct sockaddr *)&sin, sizeof(sin));
if (ret < 0) {
mlog(ML_ERROR, "unable to bind socket to port %d, ret=%d\n",
ntohs(port), ret);
mlog(ML_ERROR, "unable to bind socket at %u.%u.%u.%u:%u, "
"ret=%d\n", NIPQUAD(addr), ntohs(port), ret);
goto out;
}

ret = sock->ops->listen(sock, 64);
if (ret < 0) {
mlog(ML_ERROR, "unable to listen on port %d, ret=%d\n",
ntohs(port), ret);
mlog(ML_ERROR, "unable to listen on %u.%u.%u.%u:%u, ret=%d\n",
NIPQUAD(addr), ntohs(port), ret);
}

out:
Expand Down Expand Up @@ -1875,7 +1875,8 @@ int o2net_start_listening(struct o2nm_node *node)
return -ENOMEM; /* ? */
}

ret = o2net_open_listening_sock(node->nd_ipv4_port);
ret = o2net_open_listening_sock(node->nd_ipv4_address,
node->nd_ipv4_port);
if (ret) {
destroy_workqueue(o2net_wq);
o2net_wq = NULL;
Expand Down

0 comments on commit 13f6ab2

Please sign in to comment.