server: fix sk typo and add endian type to probe
authorJens Axboe <axboe@kernel.dk>
Tue, 4 Oct 2011 13:00:30 +0000 (15:00 +0200)
committerJens Axboe <axboe@kernel.dk>
Tue, 4 Oct 2011 13:00:30 +0000 (15:00 +0200)
Signed-off-by: Jens Axboe <axboe@kernel.dk>
client.c
server.c
server.h

index d883e651623aaa9f35b62d9151169256fd4662c8..8d066c5302925622ab64e104506b2a6f2edec41a 100644 (file)
--- 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)
index 0b1c27f4f69cf56c483e6dfe8fec6772693aa5de..dd0aeb3cb8d320e18a3ac6d3a7e4b1ac24f60796 100644 (file)
--- 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;
        }
index e129ffda8e19b53d805b696f2613eb03e23eadc5..fe762c94eb39f625e04f702648f9532c796d5957 100644 (file)
--- 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;