From patchwork Sun Sep 8 20:46:05 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Noah Peterson X-Patchwork-Id: 18658 X-Patchwork-Delegate: sw@simonwunderlich.de Return-Path: X-Original-To: patchwork@open-mesh.org Delivered-To: patchwork@open-mesh.org Received: from diktynna.open-mesh.org (localhost [IPv6:::1]) by diktynna.open-mesh.org (Postfix) with ESMTP id 1F49D83F3D for ; Sun, 8 Sep 2024 22:46:54 +0200 (CEST) ARC-Seal: i=1; cv=none; a=rsa-sha256; d=open-mesh.org; s=20121; t=1725828414; b=zfRwSwfYWajdYUswlVnfm3FDJ2f8doYnKvAXkyW8f4I/iOIb+wyIJUmevNRIzDWxndWEz N385/DNvdK+3bKJMckRlcBGRbm+yxm9eTmCPOQRTKw83IeHsMkr9e5wMcpKM0WRujS2g1A6 nt0Bw+24mP6KGFsWE/aE+/ooYNortsE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=open-mesh.org; s=20121; t=1725828414; h=from : sender : reply-to : subject : date : message-id : to : cc : mime-version : content-type : content-transfer-encoding : content-id : content-description : resent-date : resent-from : resent-sender : resent-to : resent-cc : resent-message-id : in-reply-to : references : list-id : list-help : list-unsubscribe : list-subscribe : list-post : list-owner : list-archive; bh=wwBuwDvFy5pmHsYMskSUHnL+algtxOy1KMz/ZYNT+78=; b=0+rbD5J+XlUGOtfXxSou0xtDgrHGVXEITE6Ly+zMx4JbEtMKAXEN9LdyV2Llwxb+GAiCE tcbHU3nSYURXWJL2axhRPHD7CL0MT98Iv9Zn/fUvsQat9wLwv/yQpfVNOv7UgHH5mS5ZULB yxSGhAGeGYq8UpxNew7pyFlA+tKwGD8= ARC-Authentication-Results: i=1; open-mesh.org; dkim=fail; arc=none (Message is not ARC signed); dmarc=fail (Used From Domain Record) header.from=gmail.com policy.dmarc=quarantine Authentication-Results: open-mesh.org; dkim=fail; arc=none (Message is not ARC signed); dmarc=fail (Used From Domain Record) header.from=gmail.com policy.dmarc=quarantine Received: from diktynna.open-mesh.org (localhost [IPv6:::1]) by diktynna.open-mesh.org (Postfix) with ESMTP id 85D3F81C88 for ; Sun, 8 Sep 2024 22:46:05 +0200 (CEST) MIME-Version: 1.0 Subject: [PATCH] alfred: add more verbose error message From: noahbpeterson1997@gmail.com To: b.a.t.m.a.n@lists.open-mesh.org Date: Sun, 08 Sep 2024 20:46:05 -0000 Message-ID: <172582836553.965.8382120135752040068@diktynna.open-mesh.org> User-Agent: HyperKitty on https://lists.open-mesh.org/ Message-ID-Hash: Z3CR5ESW6UTLXYFUOBVVAMXTCWNJRCUU X-Message-ID-Hash: Z3CR5ESW6UTLXYFUOBVVAMXTCWNJRCUU X-MailFrom: noahbpeterson1997@gmail.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-b.a.t.m.a.n.lists.open-mesh.org-0; header-match-b.a.t.m.a.n.lists.open-mesh.org-1; header-match-b.a.t.m.a.n.lists.open-mesh.org-2; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.8 Precedence: list List-Id: The list for a Better Approach To Mobile Ad-hoc Networking Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: There is an issue with some Linux distributions (Raspian) where network interfaces are up and active, but do not have the correct link-local address. This condition is now checked and output to stderr to better help users troubleshoot this issue. Signed-off-by: Noah Peterson noahbpeterson1997@gmail.com --- netsock.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/netsock.c b/netsock.c index feed21d..04f95c7 100644 --- a/netsock.c +++ b/netsock.c @@ -322,7 +322,23 @@ static int netsock_open(struct globals *globals, struct interface *interface) enable_raw_bind_capability(0); if (bind(sock, (struct sockaddr *)&sin6, sizeof(sin6)) < 0) { - perror("can't bind"); + if (errno == EADDRNOTAVAIL) + fprintf(stderr, "can't bind to interface %s; " + "expected ipv6 address not found: " + "%02x%02x::%02x%02x:%02x%02x:%02x%02x:%02x%02x\n", + interface->interface, + (int)interface->address.ipv6.s6_addr[0], + (int)interface->address.ipv6.s6_addr[1], + (int)interface->address.ipv6.s6_addr[8], + (int)interface->address.ipv6.s6_addr[9], + (int)interface->address.ipv6.s6_addr[10], + (int)interface->address.ipv6.s6_addr[11], + (int)interface->address.ipv6.s6_addr[12], + (int)interface->address.ipv6.s6_addr[13], + (int)interface->address.ipv6.s6_addr[14], + (int)interface->address.ipv6.s6_addr[15]); + else + perror("can't bind"); goto err; }