Skip to content

Commit 0a89efe

Browse files
matttbeintel-lab-lkp
authored andcommitted
Squash to "selftests: mptcp: add a test for mptcp_diag_dump_one"
- sdiag_protocol: avoid compilation warning: mptcp_diag.c: In function 'send_query': mptcp_diag.c:77:43: warning: unsigned conversion from 'int' to 'unsigned char' changes value from '262' to '6' [-Woverflow] 77 | .sdiag_protocol = IPPROTO_MPTCP, | ^~~~~~~~~~~~~ => the real protocol is passed via INET_DIAG_REQ_PROTOCOL. - printf: follow the same format as ss: hexa only for the token + flags. Signed-off-by: Matthieu Baerts (NGI0) <[email protected]>
1 parent 3716d83 commit 0a89efe

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

tools/testing/selftests/net/mptcp/mptcp_diag.c

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,8 @@ static void send_query(int fd, __u32 token)
7474
},
7575
.r = {
7676
.sdiag_family = AF_INET,
77-
.sdiag_protocol = IPPROTO_MPTCP,
77+
/* Real proto is set via INET_DIAG_REQ_PROTOCOL */
78+
.sdiag_protocol = IPPROTO_TCP,
7879
.id.idiag_cookie[0] = token,
7980
}
8081
};
@@ -146,12 +147,12 @@ static void print_info_msg(struct mptcp_info *info)
146147
printf("add_addr_accepted_max: %u\n", info->mptcpi_add_addr_accepted_max);
147148

148149
printf("\nTransmission Info\n");
149-
printf("write_seq: %llx\n", info->mptcpi_write_seq);
150-
printf("snd_una: %llx\n", info->mptcpi_snd_una);
151-
printf("rcv_nxt: %llx\n", info->mptcpi_rcv_nxt);
152-
printf("last_data_sent: %x\n", info->mptcpi_last_data_sent);
153-
printf("last_data_recv: %x\n", info->mptcpi_last_data_recv);
154-
printf("last_ack_recv: %x\n", info->mptcpi_last_ack_recv);
150+
printf("write_seq: %llu\n", info->mptcpi_write_seq);
151+
printf("snd_una: %llu\n", info->mptcpi_snd_una);
152+
printf("rcv_nxt: %llu\n", info->mptcpi_rcv_nxt);
153+
printf("last_data_sent: %u\n", info->mptcpi_last_data_sent);
154+
printf("last_data_recv: %u\n", info->mptcpi_last_data_recv);
155+
printf("last_ack_recv: %u\n", info->mptcpi_last_ack_recv);
155156
printf("retransmits: %u\n", info->mptcpi_retransmits);
156157
printf("retransmit bytes: %llu\n", info->mptcpi_bytes_retrans);
157158
printf("bytes_sent: %llu\n", info->mptcpi_bytes_sent);

0 commit comments

Comments
 (0)