From: Jens Axboe Date: Tue, 4 Oct 2011 13:00:30 +0000 (+0200) Subject: server: fix sk typo and add endian type to probe X-Git-Tag: fio-1.99~21 X-Git-Url: https://git.kernel.dk/?p=fio.git;a=commitdiff_plain;h=6eb2479194603184f393057ea10326643edc7169 server: fix sk typo and add endian type to probe Signed-off-by: Jens Axboe --- diff --git a/client.c b/client.c index d883e651..8d066c53 100644 --- a/client.c +++ b/client.c @@ -458,8 +458,9 @@ static void handle_probe(struct fio_net_cmd *cmd) { struct cmd_probe_pdu *probe = (struct cmd_probe_pdu *) cmd->payload; - log_info("Probe: hostname=%s, fio ver %u.%u.%u\n", probe->hostname, - probe->fio_major, probe->fio_minor, probe->fio_patch); + log_info("Probe: hostname=%s, be=%u, fio ver %u.%u.%u\n", + probe->hostname, probe->bigendian, probe->fio_major, + probe->fio_minor, probe->fio_patch); } static int handle_client(struct fio_client *client, int one) diff --git a/server.c b/server.c index 0b1c27f4..dd0aeb3c 100644 --- a/server.c +++ b/server.c @@ -324,6 +324,9 @@ static int handle_probe_cmd(struct fio_net_cmd *cmd) memset(&probe, 0, sizeof(probe)); gethostname((char *) probe.hostname, sizeof(probe.hostname)); +#ifdef FIO_BIG_ENDIAN + probe.bigendian = 1; +#endif probe.fio_major = FIO_MAJOR; probe.fio_minor = FIO_MINOR; probe.fio_patch = FIO_PATCH; @@ -645,7 +648,7 @@ static int fio_server(void) return -1; } #ifdef SO_REUSEPORT - if (setsockopt(fd, SOL_SOCKET, SO_REUSEPORT, &opt, sizeof(opt)) < 0) { + if (setsockopt(sk, SOL_SOCKET, SO_REUSEPORT, &opt, sizeof(opt)) < 0) { log_err("fio: setsockopt: %s\n", strerror(errno)); return -1; } diff --git a/server.h b/server.h index e129ffda..fe762c94 100644 --- a/server.h +++ b/server.h @@ -59,6 +59,7 @@ struct cmd_ts_pdu { struct cmd_probe_pdu { uint8_t hostname[64]; + uint8_t bigendian; uint8_t fio_major; uint8_t fio_minor; uint8_t fio_patch;