From patchwork Thu Jun 1 06:26:30 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sven Eckelmann X-Patchwork-Id: 17028 Return-Path: X-Original-To: patchwork@open-mesh.org Delivered-To: patchwork@open-mesh.org Received: from open-mesh.org (localhost [IPv6:::1]) by open-mesh.org (Postfix) with ESMTP id 7B4A181FDC; Thu, 1 Jun 2017 09:27:57 +0200 (CEST) Authentication-Results: open-mesh.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=narfation.org header.i=@narfation.org header.b="pKXnwuad"; dkim-atps=neutral Received: from v3-1039.vlinux.de (narfation.org [79.140.41.39]) by open-mesh.org (Postfix) with ESMTPS id 33D7080BA3 for ; Thu, 1 Jun 2017 08:26:36 +0200 (CEST) Received: from sven-desktop.home.narfation.org (p2003007C6F608AFE527B9DFFFECE2683.dip0.t-ipconnect.de [IPv6:2003:7c:6f60:8afe:527b:9dff:fece:2683]) by v3-1039.vlinux.de (Postfix) with ESMTPSA id 97C581100B4; Thu, 1 Jun 2017 08:26:35 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=narfation.org; s=20121; t=1496298395; bh=hBVMxvg1fAiBwYyV1eeVqCaGUqH60jWxOcS4aryJTxs=; h=From:To:Cc:Subject:Date:From; b=pKXnwuad8FU6PYw4xd1i1DiqZE8EuEJk3LGLBmgIlptLtJyXWOXa9NuZpXYJqEv/n HZsG8yAbiHEA8hVMj4xeQYLLLmYZ1fM8+0uHw330xj9f/V+NqbxcDQJrgDqz+cuYvo hkV8a1VfpG0NVyzChc++2bZ3saNcRVTcAFu7nnWM= From: Sven Eckelmann To: b.a.t.m.a.n@lists.open-mesh.org Date: Thu, 1 Jun 2017 08:26:30 +0200 Message-Id: <20170601062632.4239-1-sven@narfation.org> X-Mailer: git-send-email 2.11.0 Subject: [B.A.T.M.A.N.] [PATCH 1/3] alfred: Check if tg hash was really initialized X-BeenThere: b.a.t.m.a.n@lists.open-mesh.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: The list for a Better Approach To Mobile Ad-hoc Networking List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: The list for a Better Approach To Mobile Ad-hoc Networking Errors-To: b.a.t.m.a.n-bounces@lists.open-mesh.org Sender: "B.A.T.M.A.N" The return value check after the tg_hash_new call must actually check the return value and not some other datastructure. Fixes: a7bc3d9a2b3f ("alfred: Cache the global translation table entries") Signed-off-by: Sven Eckelmann --- server.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server.c b/server.c index 1e358cf..9774281 100644 --- a/server.c +++ b/server.c @@ -232,7 +232,7 @@ static void update_server_info(struct globals *globals) if (strcmp(globals->mesh_iface, "none") != 0) { tg_hash = tg_hash_new(globals->mesh_iface); - if (!globals->data_hash) { + if (!tg_hash) { fprintf(stderr, "Failed to create translation hash\n"); return; }