}
for(i=0; i<servers->len; i++) {
SERVER* serve = &(g_array_index(servers, SERVER, i));
- len = strlen(serve->servename);
+ len = htonl(strlen(serve->servename));
memcpy(buf, &len, sizeof(len));
strcpy(ptr, serve->servename);
- send_reply(opt, net, NBD_REP_SERVER, len+sizeof(len), buf);
+ send_reply(opt, net, NBD_REP_SERVER, strlen(serve->servename)+sizeof(len), buf);
}
send_reply(opt, net, NBD_REP_ACK, 0, NULL);
}