summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrederic Robra2019-07-10 11:42:47 +0200
committerFrederic Robra2019-07-10 11:42:47 +0200
commit699103e1f716c6d24a737d272fef77354e7f139c (patch)
treee9d1709b8866790a898fe50585423efdd798dc8a
parentupdates list of alt servers (diff)
downloaddnbd3-ng-699103e1f716c6d24a737d272fef77354e7f139c.tar.gz
dnbd3-ng-699103e1f716c6d24a737d272fef77354e7f139c.tar.xz
dnbd3-ng-699103e1f716c6d24a737d272fef77354e7f139c.zip
fixed bug in alternative servers
-rw-r--r--src/kernel/net.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/kernel/net.c b/src/kernel/net.c
index 2931aea..ef3988e 100644
--- a/src/kernel/net.c
+++ b/src/kernel/net.c
@@ -330,9 +330,7 @@ static void discovery(struct work_struct *work)
dnbd3_sock *sock = &dev->socks[0]; // we use the first sock for discovery
struct request *req;
int i, j;
- struct dnbd3_server *existing_server = NULL;
- struct dnbd3_server *free_server = NULL;
- struct dnbd3_server *failed_server = NULL;
+ struct dnbd3_server *existing_server, *free_server, *failed_server;
dnbd3_server_entry_t *new_server;
printk(KERN_DEBUG "dnbd3: starting discovery worker\n");
mutex_lock(&sock->lock);
@@ -355,6 +353,9 @@ static void discovery(struct work_struct *work)
for (i = 0; i < dev->new_servers_num; i++) {
new_server = &dev->new_servers[i];
if (new_server->host.type == HOST_IP4 || new_server->host.type == HOST_IP6) {
+ existing_server = NULL;
+ free_server = NULL;
+ failed_server = NULL;
// find servers in alt servers
for (j = 0; j < NUMBER_SERVERS; j++) {