From nobody Thu Jun 2 00:46:55 2022 X-Original-To: dev-commits-ports-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id B043A1B63571; Thu, 2 Jun 2022 00:46:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4LD6lz4YFVz3hGc; Thu, 2 Jun 2022 00:46:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1654130815; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=sLdPUp13GDmn+f7VM5ZkaxDJ1zVNQK5WHYp80mAOghU=; b=Aw3Mjp2mQTROGBPXmVBLbydapmBiApU+cv1q+vyyVmFz96Zh4soM+M7pwWDnnWmzkpcAn1 Twhoa48HaRig3elMqNJqXmcJniyD5pOPEyRgqUX+r0ccAAQo8qcPkrSG9G0Lyeaw4zQuZJ urfbtf1HOHN/ciox5DstZ5seNj8O0+qT06FNk2ZGdjj0BYa4WHp8/5BSmrPmPQnR2GqQzI d1eMF7QLLA/8dvU+9JVdJjeBhbEHQ9X20E1QW1nheCnIY9FyDJ8PG7I5DCl1SDXLim4LcA 4xDs7yxo36l8N5j6aVqC1M8E+oOM6U2xOg0R0XwDVWTWlNhbKveJaBbqkspcYg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7C44026AF; Thu, 2 Jun 2022 00:46:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 2520ktdq072529; Thu, 2 Jun 2022 00:46:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 2520kt7D072528; Thu, 2 Jun 2022 00:46:55 GMT (envelope-from git) Date: Thu, 2 Jun 2022 00:46:55 GMT Message-Id: <202206020046.2520kt7D072528@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Craig Leres Subject: git: 65d71ce9bdd9 - main - net/fping: Avoid ident collisions List-Id: Commit messages for all branches of the ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-ports-all@freebsd.org X-BeenThere: dev-commits-ports-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: leres X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 65d71ce9bdd96d79b5c9cffafc144fe23ebf6b15 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1654130815; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=sLdPUp13GDmn+f7VM5ZkaxDJ1zVNQK5WHYp80mAOghU=; b=mrWCmY5+hQh0cxvMhEuwyjuTlsn6osZZky/J5RniQJIkLeDJEFu3ml2280E3eWA3JXCCWu o4g1ro935lvJqe+9xfI0EZDcJysWhrEk/25xiQtL0myaffnaZNZZp9O5loVGCzTXWaiDVs Ng5/7Y9P2eVIM91tvZaZpRVLa8p9f7RMYezRo42vNiJu8rPFgJr0+Wvb96g/djS+XiDLus RK+2PPbtpWt7qplobLLPgnZ+ZRpm3+5Fq7YoYd3OMX+nGgBB2pscc9yfu6soRg/mAcKDjl os3H5+FrON2T4mGhDxRJ813G4jMpyMDXvnGEY4SW859G9JkP8bUj+E0kJ0oZFw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1654130815; a=rsa-sha256; cv=none; b=xFXkzl+/PCPUwijRXDodJy6HEtOeuIVM2nFoA4WavmQ/vWLvyV71zrWCIUetzh2JxjZ4wj +36l+C3ASz+3sOJB/sLtivKR8gCLJMfLDTetJ4rJbbZ1zJk3Vzno1SQQJOlBxdc8meN98x DxLbb6nJDsLi17L/O1/2s98jQay7w4TN5KasD4SWZAkzOv++KtEugBOD0yImxqwZA3ONGT me03o+MC0pitXwFQCwVOa2fikha0J7jKJaIYmh+JsWuyyfJPKNMZZFM95DaRh5KA0/CUGO LZCIY+FB03myc7Ve3/9IFnF2GlAmDSysaB3SN1IazsUZRKxzsitWCqmaAiLcNw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by leres: URL: https://cgit.FreeBSD.org/ports/commit/?id=65d71ce9bdd96d79b5c9cffafc144fe23ebf6b15 commit 65d71ce9bdd96d79b5c9cffafc144fe23ebf6b15 Author: Craig Leres AuthorDate: 2022-06-02 00:46:21 +0000 Commit: Craig Leres CommitDate: 2022-06-02 00:46:21 +0000 net/fping: Avoid ident collisions fping derives the ident it puts in the outbound packet to from the low 16 bits of the process id. This means a busy nagios server can see collisions. More details on this issue and a patch to solve it here: https://github.com/schweikert/fping/issues/206 Apply the patch from the github issue: PR: 264402 Reported by: Case Larsen Approved by: jharris (maintainer) --- net/fping/Makefile | 2 +- net/fping/files/patch-fping.c | 23 +++++++++++++++++++++++ 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/net/fping/Makefile b/net/fping/Makefile index af42b27bf518..1a3c2d858d24 100644 --- a/net/fping/Makefile +++ b/net/fping/Makefile @@ -2,7 +2,7 @@ PORTNAME= fping PORTVERSION= 5.0 -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= net MASTER_SITES= http://fping.org/dist/ \ https://github.com/schweikert/${PORTNAME}/releases/download/v${PORTVERSION}/ diff --git a/net/fping/files/patch-fping.c b/net/fping/files/patch-fping.c index 054f171fad67..e8b5343c04ba 100644 --- a/net/fping/files/patch-fping.c +++ b/net/fping/files/patch-fping.c @@ -14,3 +14,26 @@ socket_set_src_addr_ipv6(socket6, &src_addr6, (socktype6 == SOCK_DGRAM) ? &ident6 : NULL); } #endif +@@ -2299,6 +2299,22 @@ int wait_for_reply(int64_t wait_time) + #endif + else { + return 1; ++ } ++ ++ /* Check that src address is one of the hosts we pinged before */ ++ int found = 0; ++ for (int i = 0; i < num_hosts; i++) { ++ HOST_ENTRY *h = table[i]; ++ if (!addr_cmp((struct sockaddr*)&response_addr, (struct sockaddr*)&h->saddr)) { ++ found = 1; ++ break; ++ } ++ } ++ if (!found) { ++ // char buf[INET6_ADDRSTRLEN]; ++ // getnameinfo((struct sockaddr*)&response_addr, sizeof(response_addr), buf, INET6_ADDRSTRLEN, NULL, 0, NI_NUMERICHOST); ++ // fprintf(stderr, "ignoring response from %s\n", buf); ++ return 1; /* packet received, but not from a host we pinged */ + } + + seqmap_value = seqmap_fetch(seq, current_time_ns);