Skip to content

Commit

Permalink
Merge branch 'rds-tcp-fixes'
Browse files Browse the repository at this point in the history
Sowmini Varadhan says:

====================
RDS: TCP: bug fixes

A couple of bug fixes identified during testing.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
David S. Miller committed Nov 9, 2016
2 parents f5f9930 + 117d15b commit ddc5e15
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
20 changes: 13 additions & 7 deletions net/rds/tcp.c
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ void rds_tcp_set_callbacks(struct socket *sock, struct rds_conn_path *cp)
write_unlock_bh(&sock->sk->sk_callback_lock);
}

static void rds_tcp_tc_info(struct socket *sock, unsigned int len,
static void rds_tcp_tc_info(struct socket *rds_sock, unsigned int len,
struct rds_info_iterator *iter,
struct rds_info_lengths *lens)
{
Expand All @@ -229,6 +229,7 @@ static void rds_tcp_tc_info(struct socket *sock, unsigned int len,
unsigned long flags;
struct sockaddr_in sin;
int sinlen;
struct socket *sock;

spin_lock_irqsave(&rds_tcp_tc_list_lock, flags);

Expand All @@ -237,12 +238,17 @@ static void rds_tcp_tc_info(struct socket *sock, unsigned int len,

list_for_each_entry(tc, &rds_tcp_tc_list, t_list_item) {

sock->ops->getname(sock, (struct sockaddr *)&sin, &sinlen, 0);
tsinfo.local_addr = sin.sin_addr.s_addr;
tsinfo.local_port = sin.sin_port;
sock->ops->getname(sock, (struct sockaddr *)&sin, &sinlen, 1);
tsinfo.peer_addr = sin.sin_addr.s_addr;
tsinfo.peer_port = sin.sin_port;
sock = tc->t_sock;
if (sock) {
sock->ops->getname(sock, (struct sockaddr *)&sin,
&sinlen, 0);
tsinfo.local_addr = sin.sin_addr.s_addr;
tsinfo.local_port = sin.sin_port;
sock->ops->getname(sock, (struct sockaddr *)&sin,
&sinlen, 1);
tsinfo.peer_addr = sin.sin_addr.s_addr;
tsinfo.peer_port = sin.sin_port;
}

tsinfo.hdr_rem = tc->t_tinc_hdr_rem;
tsinfo.data_rem = tc->t_tinc_data_rem;
Expand Down
2 changes: 1 addition & 1 deletion net/rds/tcp_listen.c
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ struct rds_tcp_connection *rds_tcp_accept_one_path(struct rds_connection *conn)
if (!peer_is_smaller)
return NULL;

for (i = 1; i < npaths; i++) {
for (i = 0; i < npaths; i++) {
struct rds_conn_path *cp = &conn->c_path[i];

if (rds_conn_path_transition(cp, RDS_CONN_DOWN,
Expand Down

0 comments on commit ddc5e15

Please sign in to comment.