Skip to content

Commit 40eb90e

Browse files
lxindavem330
authored andcommitted
sctp: sctp_diag should dump sctp socket type
Now we cannot distinguish that one sk is a udp or sctp style when we use ss to dump sctp_info. it's necessary to dump it as well. For sctp_diag, ss support is not officially available, thus there are no official users of this yet, so we can add this field in the middle of sctp_info without breaking user API. v1->v2: - move 'sctpi_s_type' field to the end of struct sctp_info, so that it won't cause incompatibility with applications already built. - add __reserved3 in sctp_info to make sure sctp_info is 8-byte alignment. Signed-off-by: Xin Long <lucien.xin@gmail.com> Acked-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com> Acked-by: Neil Horman <nhorman@tuxdriver.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 7fafe80 commit 40eb90e

2 files changed

Lines changed: 3 additions & 0 deletions

File tree

‎include/linux/sctp.h‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -765,6 +765,8 @@ struct sctp_info {
765765
__u8 sctpi_s_disable_fragments;
766766
__u8 sctpi_s_v4mapped;
767767
__u8 sctpi_s_frag_interleave;
768+
__u32 sctpi_s_type;
769+
__u32 __reserved3;
768770
};
769771

770772
struct sctp_infox {

‎net/sctp/socket.c‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4220,6 +4220,7 @@ int sctp_get_sctp_info(struct sock *sk, struct sctp_association *asoc,
42204220
info->sctpi_s_disable_fragments = sp->disable_fragments;
42214221
info->sctpi_s_v4mapped = sp->v4mapped;
42224222
info->sctpi_s_frag_interleave = sp->frag_interleave;
4223+
info->sctpi_s_type = sp->type;
42234224

42244225
return 0;
42254226
}

0 commit comments

Comments
 (0)