diff options
author | Frederic Robra | 2019-07-10 11:42:47 +0200 |
---|---|---|
committer | Frederic Robra | 2019-07-10 11:42:47 +0200 |
commit | 699103e1f716c6d24a737d272fef77354e7f139c (patch) | |
tree | e9d1709b8866790a898fe50585423efdd798dc8a | |
parent | updates list of alt servers (diff) | |
download | dnbd3-ng-699103e1f716c6d24a737d272fef77354e7f139c.tar.gz dnbd3-ng-699103e1f716c6d24a737d272fef77354e7f139c.tar.xz dnbd3-ng-699103e1f716c6d24a737d272fef77354e7f139c.zip |
fixed bug in alternative servers
-rw-r--r-- | src/kernel/net.c | 7 |
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++) { |