Skip to content

Commit 891310d

Browse files
mbaldessaridavem330
authored andcommitted
sctp: add transport state in /proc/net/sctp/remaddr
It is often quite helpful to be able to know the state of a transport outside of the application itself (for troubleshooting purposes or for monitoring purposes). Add it under /proc/net/sctp/remaddr. Signed-off-by: Michele Baldessari <michele@acksyn.org> Acked-by: Neil Horman <nhorman@tuxdriver.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent b2ad5e5 commit 891310d

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

net/sctp/proc.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -417,7 +417,7 @@ static void *sctp_remaddr_seq_start(struct seq_file *seq, loff_t *pos)
417417

418418
if (*pos == 0)
419419
seq_printf(seq, "ADDR ASSOC_ID HB_ACT RTO MAX_PATH_RTX "
420-
"REM_ADDR_RTX START\n");
420+
"REM_ADDR_RTX START STATE\n");
421421

422422
return (void *)pos;
423423
}
@@ -497,7 +497,13 @@ static int sctp_remaddr_seq_show(struct seq_file *seq, void *v)
497497
* currently implemented, but we can record it with a
498498
* jiffies marker in a subsequent patch
499499
*/
500-
seq_printf(seq, "0");
500+
seq_printf(seq, "0 ");
501+
502+
/*
503+
* The current state of this destination. I.e.
504+
* SCTP_ACTIVE, SCTP_INACTIVE, ...
505+
*/
506+
seq_printf(seq, "%d", tsp->state);
501507

502508
seq_printf(seq, "\n");
503509
}

0 commit comments

Comments
 (0)