From nobody Wed Mar 1 20:58:32 2023 X-Original-To: freebsd-net@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 4PRmmg4zzZz3vLWf for ; Wed, 1 Mar 2023 20:58:43 +0000 (UTC) (envelope-from michael.tuexen@lurchi.franken.de) Received: from drew.franken.de (drew.ipv6.franken.de [IPv6:2001:638:a02:a001:20e:cff:fe4a:feaa]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.franken.de", Issuer "Sectigo RSA Domain Validation Secure Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PRmmg32s5z3BvR; Wed, 1 Mar 2023 20:58:43 +0000 (UTC) (envelope-from michael.tuexen@lurchi.franken.de) Authentication-Results: mx1.freebsd.org; none Received: from smtpclient.apple (unknown [IPv6:2a02:8109:1140:c3d:c64:cf31:7eab:fd78]) (Authenticated sender: lurchi) by drew.franken.de (Postfix) with ESMTPSA id 728CF7213B547; Wed, 1 Mar 2023 21:58:33 +0100 (CET) Content-Type: text/plain; charset=us-ascii List-Id: Networking and TCP/IP with FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-net List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-net@freebsd.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.400.51.1.1\)) Subject: Re: BPF to filter/mod ARP From: Michael Tuexen In-Reply-To: Date: Wed, 1 Mar 2023 21:58:32 +0100 Cc: freebsd-net@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <02B65D42-5097-421A-B951-C947C5DBA465@lurchi.franken.de> References: To: "Scheffenegger, Richard" X-Mailer: Apple Mail (2.3731.400.51.1.1) X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=disabled version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on mail-n.franken.de X-Rspamd-Queue-Id: 4PRmmg32s5z3BvR X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:680, ipnet:2001:638::/32, country:DE] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-ThisMailContainsUnwantedMimeParts: N > On 1. Mar 2023, at 21:33, Scheffenegger, Richard = wrote: >=20 > Hi group, >=20 > Maybe someone can help me with this question - as I am usually only = looking at L4 and the top side of L3 ;) >=20 > In order to validate a peculiar switches behavior, I want to adjust = some fields in gracious arps sent out by an interface, after a new IP is = assigned or changed. Wouldn't scapy allow you to do this kind of testing? Best regards Michael >=20 > I believe BPF can effectively filter on arbitrary bit patterns and = modify packets on the fly. >=20 > However, as ARP doesn't seem to be accessible in the ipfw = infrastructure, I was wondering how to go about setting up an BPF to = tweak (temporarily) some of these ARPs to validate how the switch will = behave. >=20 > (I need to validate, if there is some difference when the target = hardware address doesn't conform to RFC5227 - which states it SHOULD be = zero and is ignored on the receiving side; i have reasons to believe = that the switch needs either a target hardware address of = ff:ff:ff:ff:ff:ff or the local interface MAC, to properly update it's = entries.) >=20 > Thanks a lot! >=20 > Richard >