From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by passt.top (Postfix) with ESMTP id DCCD75A0082 for ; Tue, 25 Oct 2022 19:25:53 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1666718752; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=FQ5QAHzhaErGSDEr9wShexE0g7KaRuQ8wKEIDFyXmLw=; b=Bwx5pLoNI4wmhcgTg0xkUdoZrO6zZKk+LwKalseW80bHY1bwiNxdY9qIXsh1/wjQmQJ98A GTOhayqQCGJRSmE2nERaTFLO7h8zFUjxe74zuSuczbcmVTcpdlejkGqzMJhdcvBcUPJ237 /SdyTVYhtmPnj9P5H79zh1Uu/UJCpe0= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-582-75poyQjBPdirRdeYU13blw-1; Tue, 25 Oct 2022 13:25:48 -0400 X-MC-Unique: 75poyQjBPdirRdeYU13blw-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id DC09F811E87; Tue, 25 Oct 2022 17:25:47 +0000 (UTC) Received: from maya.cloud.tilaa.com (ovpn-208-31.brq.redhat.com [10.40.208.31]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 7E07A10197; Tue, 25 Oct 2022 17:25:46 +0000 (UTC) Date: Tue, 25 Oct 2022 19:25:41 +0200 From: Stefano Brivio To: passt-dev@passt.top Subject: Re: [PATCH] checksum: Fix calculation for ICMP checksum on IPv4 Message-ID: <20221025192541.18e837af@elisabeth> In-Reply-To: <20221025160713.1024373-1-sbrivio@redhat.com> References: <20221025160713.1024373-1-sbrivio@redhat.com> Organization: Red Hat MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.5 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Message-ID-Hash: FRTMULNJWBPDBLAFVVPWMFLD2EJ6EWU5 X-Message-ID-Hash: FRTMULNJWBPDBLAFVVPWMFLD2EJ6EWU5 X-MailFrom: sbrivio@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Paul Holzinger , David Gibson X-Mailman-Version: 3.3.3 Precedence: list List-Id: Development discussion and patches for passt Archived-At: <> Archived-At: List-Archive: <> List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: On Tue, 25 Oct 2022 18:07:13 +0200 Stefano Brivio wrote: > We need to zero out the checksum field before calculating the > checksum, of course. I have no idea how this passed the "icmp" test > set, looking into it. That's because the version of ping(8) I use on my test machine, from 'iputils', ignores a failed checksum in the reply: https://github.com/iputils/iputils/blob/59908434d7505ef574c2e0811ad1d5edb671845a/ping/ping.c#L1544 ...the parameter 'csfailed' in gather_statistics() is just passed as 0 here. The checksum was actually wrong in the CI test run. Forcing a specific version (e.g. from GNU inetutils) looks rather messy and non-portable, so I'm afraid there isn't much we can do for this, other than being careful. -- Stefano