diff options
author | David S. Miller <davem@davemloft.net> | 2016-11-09 12:47:50 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-11-09 12:47:50 -0500 |
commit | ddc5e157294dd0f6e71eecd4894af481583de7c1 (patch) | |
tree | f090751bc2a2e11ca793b2edcd14d76f1401a6f3 | |
parent | f5f99309fa7481f59a500f0d08f3379cd6424c1f (diff) | |
parent | 117d15bbfde643b5bd0a173fddaa0e6c65f14d47 (diff) | |
download | net-next-ddc5e157294dd0f6e71eecd4894af481583de7c1.tar.gz |
Merge branch 'rds-tcp-fixes'
Sowmini Varadhan says:
====================
RDS: TCP: bug fixes
A couple of bug fixes identified during testing.
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | net/rds/tcp.c | 20 | ||||
-rw-r--r-- | net/rds/tcp_listen.c | 2 |
2 files changed, 14 insertions, 8 deletions
diff --git a/net/rds/tcp.c b/net/rds/tcp.c index fcddacc92e018..3296a6ac583ab 100644 --- a/net/rds/tcp.c +++ b/net/rds/tcp.c @@ -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) { @@ -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); @@ -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; diff --git a/net/rds/tcp_listen.c b/net/rds/tcp_listen.c index e0b23fb5b8d50..c9c496844cd7a 100644 --- a/net/rds/tcp_listen.c +++ b/net/rds/tcp_listen.c @@ -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, |