Skip to content

Commit e7f625b

Browse files
Dwyane-Yanintel-lab-lkp
authored andcommitted
selftests: mptcp: refine the 'iovlen' handling logic
In the original version, the handling logic for the 'iovlen' appeared somewhat redundant. Therefore, 'iovlen++' is used to simpify this portion of the code and improve its readaility. Co-developed-by: Geliang Tang <[email protected]> Signed-off-by: Geliang Tang <[email protected]> Signed-off-by: Gang Yan <[email protected]>
1 parent 0b1b2c4 commit e7f625b

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,10 +91,9 @@ static void send_query(int fd, struct inet_diag_req_v2 *r)
9191
.iov_base = &req,
9292
.iov_len = sizeof(req)
9393
};
94-
iov[iovlen] = (struct iovec){ &rta_proto, sizeof(rta_proto)};
95-
iov[iovlen + 1] = (struct iovec){ &proto, sizeof(proto)};
94+
iov[iovlen++] = (struct iovec){ &rta_proto, sizeof(rta_proto)};
95+
iov[iovlen++] = (struct iovec){ &proto, sizeof(proto)};
9696
req.nlh.nlmsg_len += RTA_LENGTH(sizeof(proto));
97-
iovlen += 2;
9897
struct msghdr msg = {
9998
.msg_name = &nladdr,
10099
.msg_namelen = sizeof(nladdr),

0 commit comments

Comments
 (0)