X-Git-Url: https://git.kernel.dk/?a=blobdiff_plain;f=engines%2Fnet.c;h=cd19535294a083eff56c97036aef75f8c4615541;hb=0c5df5f9adccf9e3d8aaba88258ae9a4e0d3b643;hp=7c0a4eb41c010f75f97a25023f1a5897160a10c3;hpb=6b37db5bd2e57871691ee9e83264d98f20d28a01;p=fio.git diff --git a/engines/net.c b/engines/net.c index 7c0a4eb4..cd195352 100644 --- a/engines/net.c +++ b/engines/net.c @@ -484,8 +484,11 @@ static void store_udp_seq(struct netio_data *nd, struct io_u *io_u) { struct udp_seq *us; + if (io_u->xfer_buflen < sizeof(*us)) + return; + us = io_u->xfer_buf + io_u->xfer_buflen - sizeof(*us); - us->magic = cpu_to_le64(FIO_UDP_SEQ_MAGIC); + us->magic = cpu_to_le64((uint64_t) FIO_UDP_SEQ_MAGIC); us->bs = cpu_to_le64((uint64_t) io_u->xfer_buflen); us->seq = cpu_to_le64(nd->udp_send_seq++); } @@ -496,6 +499,9 @@ static void verify_udp_seq(struct thread_data *td, struct netio_data *nd, struct udp_seq *us; uint64_t seq; + if (io_u->xfer_buflen < sizeof(*us)) + return; + if (nd->seq_off) return; @@ -1308,6 +1314,8 @@ static int fio_netio_init(struct thread_data *td) return 1; } + o->port += td->subjob_number; + if (!is_tcp(o)) { if (o->listen) { log_err("fio: listen only valid for TCP proto IO\n");