aboutsummaryrefslogtreecommitdiffstats
path: root/net/sctp/proc.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/sctp/proc.c')
-rw-r--r--net/sctp/proc.c27
1 files changed, 16 insertions, 11 deletions
diff --git a/net/sctp/proc.c b/net/sctp/proc.c
index 973f1dbc2ec3..0aba759cb9b7 100644
--- a/net/sctp/proc.c
+++ b/net/sctp/proc.c
@@ -124,7 +124,6 @@ void sctp_snmp_proc_exit(void)
124/* Dump local addresses of an association/endpoint. */ 124/* Dump local addresses of an association/endpoint. */
125static void sctp_seq_dump_local_addrs(struct seq_file *seq, struct sctp_ep_common *epb) 125static void sctp_seq_dump_local_addrs(struct seq_file *seq, struct sctp_ep_common *epb)
126{ 126{
127 struct list_head *pos;
128 struct sctp_association *asoc; 127 struct sctp_association *asoc;
129 struct sctp_sockaddr_entry *laddr; 128 struct sctp_sockaddr_entry *laddr;
130 struct sctp_transport *peer; 129 struct sctp_transport *peer;
@@ -137,8 +136,7 @@ static void sctp_seq_dump_local_addrs(struct seq_file *seq, struct sctp_ep_commo
137 primary = &peer->saddr; 136 primary = &peer->saddr;
138 } 137 }
139 138
140 list_for_each(pos, &epb->bind_addr.address_list) { 139 list_for_each_entry(laddr, &epb->bind_addr.address_list, list) {
141 laddr = list_entry(pos, struct sctp_sockaddr_entry, list);
142 addr = &laddr->a; 140 addr = &laddr->a;
143 af = sctp_get_af_specific(addr->sa.sa_family); 141 af = sctp_get_af_specific(addr->sa.sa_family);
144 if (primary && af->cmp_addr(addr, primary)) { 142 if (primary && af->cmp_addr(addr, primary)) {
@@ -151,14 +149,13 @@ static void sctp_seq_dump_local_addrs(struct seq_file *seq, struct sctp_ep_commo
151/* Dump remote addresses of an association. */ 149/* Dump remote addresses of an association. */
152static void sctp_seq_dump_remote_addrs(struct seq_file *seq, struct sctp_association *assoc) 150static void sctp_seq_dump_remote_addrs(struct seq_file *seq, struct sctp_association *assoc)
153{ 151{
154 struct list_head *pos;
155 struct sctp_transport *transport; 152 struct sctp_transport *transport;
156 union sctp_addr *addr, *primary; 153 union sctp_addr *addr, *primary;
157 struct sctp_af *af; 154 struct sctp_af *af;
158 155
159 primary = &assoc->peer.primary_addr; 156 primary = &assoc->peer.primary_addr;
160 list_for_each(pos, &assoc->peer.transport_addr_list) { 157 list_for_each_entry(transport, &assoc->peer.transport_addr_list,
161 transport = list_entry(pos, struct sctp_transport, transports); 158 transports) {
162 addr = &transport->ipaddr; 159 addr = &transport->ipaddr;
163 af = sctp_get_af_specific(addr->sa.sa_family); 160 af = sctp_get_af_specific(addr->sa.sa_family);
164 if (af->cmp_addr(addr, primary)) { 161 if (af->cmp_addr(addr, primary)) {
@@ -279,8 +276,10 @@ static void * sctp_assocs_seq_start(struct seq_file *seq, loff_t *pos)
279 *pos = 0; 276 *pos = 0;
280 277
281 if (*pos == 0) 278 if (*pos == 0)
282 seq_printf(seq, " ASSOC SOCK STY SST ST HBKT ASSOC-ID TX_QUEUE RX_QUEUE UID INODE LPORT " 279 seq_printf(seq, " ASSOC SOCK STY SST ST HBKT "
283 "RPORT LADDRS <-> RADDRS\n"); 280 "ASSOC-ID TX_QUEUE RX_QUEUE UID INODE LPORT "
281 "RPORT LADDRS <-> RADDRS "
282 "HBINT INS OUTS MAXRT T1X T2X RTXC\n");
284 283
285 return (void *)pos; 284 return (void *)pos;
286} 285}
@@ -319,19 +318,25 @@ static int sctp_assocs_seq_show(struct seq_file *seq, void *v)
319 assoc = sctp_assoc(epb); 318 assoc = sctp_assoc(epb);
320 sk = epb->sk; 319 sk = epb->sk;
321 seq_printf(seq, 320 seq_printf(seq,
322 "%8p %8p %-3d %-3d %-2d %-4d %4d %8d %8d %7d %5lu %-5d %5d ", 321 "%8p %8p %-3d %-3d %-2d %-4d "
322 "%4d %8d %8d %7d %5lu %-5d %5d ",
323 assoc, sk, sctp_sk(sk)->type, sk->sk_state, 323 assoc, sk, sctp_sk(sk)->type, sk->sk_state,
324 assoc->state, hash, assoc->assoc_id, 324 assoc->state, hash,
325 assoc->assoc_id,
325 assoc->sndbuf_used, 326 assoc->sndbuf_used,
326 atomic_read(&assoc->rmem_alloc), 327 atomic_read(&assoc->rmem_alloc),
327 sock_i_uid(sk), sock_i_ino(sk), 328 sock_i_uid(sk), sock_i_ino(sk),
328 epb->bind_addr.port, 329 epb->bind_addr.port,
329 assoc->peer.port); 330 assoc->peer.port);
330
331 seq_printf(seq, " "); 331 seq_printf(seq, " ");
332 sctp_seq_dump_local_addrs(seq, epb); 332 sctp_seq_dump_local_addrs(seq, epb);
333 seq_printf(seq, "<-> "); 333 seq_printf(seq, "<-> ");
334 sctp_seq_dump_remote_addrs(seq, assoc); 334 sctp_seq_dump_remote_addrs(seq, assoc);
335 seq_printf(seq, "\t%8lu %5d %5d %4d %4d %4d %8d ",
336 assoc->hbinterval, assoc->c.sinit_max_instreams,
337 assoc->c.sinit_num_ostreams, assoc->max_retrans,
338 assoc->init_retries, assoc->shutdown_retries,
339 assoc->rtx_data_chunks);
335 seq_printf(seq, "\n"); 340 seq_printf(seq, "\n");
336 } 341 }
337 read_unlock(&head->lock); 342 read_unlock(&head->lock);