Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 19026
b: refs/heads/master
c: 49392e5
h: refs/heads/master
v: v3
  • Loading branch information
Vlad Yasevich authored and Sridhar Samudrala committed Jan 17, 2006
1 parent f9bd6fd commit 318e77a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 19 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: 9834a2bb4970547540222fcba04e0a37d04cb0a0
refs/heads/master: 49392e5ecf608da6770fd8723b534a0fc851edc4
28 changes: 10 additions & 18 deletions trunk/net/sctp/proc.c
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ static void sctp_seq_dump_remote_addrs(struct seq_file *seq, struct sctp_associa

static void * sctp_eps_seq_start(struct seq_file *seq, loff_t *pos)
{
if (*pos > sctp_ep_hashsize)
if (*pos >= sctp_ep_hashsize)
return NULL;

if (*pos < 0)
Expand All @@ -185,8 +185,6 @@ static void * sctp_eps_seq_start(struct seq_file *seq, loff_t *pos)
if (*pos == 0)
seq_printf(seq, " ENDPT SOCK STY SST HBKT LPORT UID INODE LADDRS\n");

++*pos;

return (void *)pos;
}

Expand All @@ -198,11 +196,9 @@ static void sctp_eps_seq_stop(struct seq_file *seq, void *v)

static void * sctp_eps_seq_next(struct seq_file *seq, void *v, loff_t *pos)
{
if (*pos > sctp_ep_hashsize)
if (++*pos >= sctp_ep_hashsize)
return NULL;

++*pos;

return pos;
}

Expand All @@ -216,17 +212,17 @@ static int sctp_eps_seq_show(struct seq_file *seq, void *v)
struct sock *sk;
int hash = *(int *)v;

if (hash > sctp_ep_hashsize)
if (hash >= sctp_ep_hashsize)
return -ENOMEM;

head = &sctp_ep_hashtable[hash-1];
head = &sctp_ep_hashtable[hash];
sctp_local_bh_disable();
read_lock(&head->lock);
for (epb = head->chain; epb; epb = epb->next) {
ep = sctp_ep(epb);
sk = epb->sk;
seq_printf(seq, "%8p %8p %-3d %-3d %-4d %-5d %5d %5lu ", ep, sk,
sctp_sk(sk)->type, sk->sk_state, hash-1,
sctp_sk(sk)->type, sk->sk_state, hash,
epb->bind_addr.port,
sock_i_uid(sk), sock_i_ino(sk));

Expand Down Expand Up @@ -283,7 +279,7 @@ void sctp_eps_proc_exit(void)

static void * sctp_assocs_seq_start(struct seq_file *seq, loff_t *pos)
{
if (*pos > sctp_assoc_hashsize)
if (*pos >= sctp_assoc_hashsize)
return NULL;

if (*pos < 0)
Expand All @@ -293,8 +289,6 @@ static void * sctp_assocs_seq_start(struct seq_file *seq, loff_t *pos)
seq_printf(seq, " ASSOC SOCK STY SST ST HBKT ASSOC-ID TX_QUEUE RX_QUEUE UID INODE LPORT "
"RPORT LADDRS <-> RADDRS\n");

++*pos;

return (void *)pos;
}

Expand All @@ -306,11 +300,9 @@ static void sctp_assocs_seq_stop(struct seq_file *seq, void *v)

static void * sctp_assocs_seq_next(struct seq_file *seq, void *v, loff_t *pos)
{
if (*pos > sctp_assoc_hashsize)
if (++*pos >= sctp_assoc_hashsize)
return NULL;

++*pos;

return pos;
}

Expand All @@ -323,10 +315,10 @@ static int sctp_assocs_seq_show(struct seq_file *seq, void *v)
struct sock *sk;
int hash = *(int *)v;

if (hash > sctp_assoc_hashsize)
if (hash >= sctp_assoc_hashsize)
return -ENOMEM;

head = &sctp_assoc_hashtable[hash-1];
head = &sctp_assoc_hashtable[hash];
sctp_local_bh_disable();
read_lock(&head->lock);
for (epb = head->chain; epb; epb = epb->next) {
Expand All @@ -335,7 +327,7 @@ static int sctp_assocs_seq_show(struct seq_file *seq, void *v)
seq_printf(seq,
"%8p %8p %-3d %-3d %-2d %-4d %4d %8d %8d %7d %5lu %-5d %5d ",
assoc, sk, sctp_sk(sk)->type, sk->sk_state,
assoc->state, hash-1, assoc->assoc_id,
assoc->state, hash, assoc->assoc_id,
(sk->sk_rcvbuf - assoc->rwnd),
assoc->sndbuf_used,
sock_i_uid(sk), sock_i_ino(sk),
Expand Down

0 comments on commit 318e77a

Please sign in to comment.