From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from tb-mx0.topicbox.com (localhost.local [127.0.0.1]) by tb-mx0.topicbox.com (Postfix) with ESMTP id 6C6321B02063 for ; Thu, 6 Jun 2024 08:54:59 -0400 (EDT) (envelope-from marcel@telka.sk) Received: from tb-mx0.topicbox.com (localhost [127.0.0.1]) by tb-mx0.topicbox.com (Authentication Milter) with ESMTP id 1F6A101DAA2; Thu, 6 Jun 2024 08:54:59 -0400 ARC-Seal: i=1; a=rsa-sha256; cv=none; d=topicbox.com; s=arcseal; t= 1717678499; b=cVIGtJDkhiCmEQLzfRVHKnjazNK9IAmfZhVdFQ49D7ulpWtL3k vBud/s2hOcUD2g/SY/6zjy/qRU24dBvaVBduNGI7tR5sOcaLhopBcy5K9eRqiRJj SkuZEOlL4ULJgCnvRmmm1+UqZVOWklw0OBTjJIeYFAiSg+78Yt/CAnnIWbbCOh9P fIY1MZ2QMuC8evN4IfEXaXd0yIystFJI+mkNFaNQnD9H8IlKo0qFcCXYhl/hY65+ N+8PrxyVxcV6agGCnK1lAnAYMt24LXiYHXPQUVGI1ro66008Uhm+pbCcjGyZUu6v W4KuRQOSPNCvHU7ao9drI1HDoue72D9fAGYQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d= topicbox.com; h=date:from:to:subject:message-id:references :mime-version:content-type:in-reply-to; s=arcseal; t=1717678499; bh=UW3tQ5HAtsW3TDifAWSndsX/MCf2x1zOnINA78C6b6o=; b=IxcAeDPrP8DA yWmBtJpuHnwEFzJQJxpCE4w9ApAP+8uxhP2ljjNQ2rJNBtJEPo9ZZUq3VCz5cZEd 1Uqrcg5/FEPsMNgyiy/ktlMQkvjeBbnvDTQMvHfCFAeCETfv/vEbqPLRHIbHropl JHWo2my61iuxgDKxv/JIe9KdITnzyckS0hGDg3XX0mFEfRnelFtQItjQlZXSEZNv HaXIBhzMgxWQ2H3ER5T0SwEQo8L06PEknALkKpqUgc8JfONkk21edf+GCYx9g4Wt Rn0uiRrdb11QDkFQjiRj9P8J4L02JBUXAmxK4tgzAiLFqwj3WsrR41oebJBsY1Az tkGWw6c+Uw== ARC-Authentication-Results: i=1; tb-mx0.topicbox.com; arc=none (no signatures found); bimi=skipped (DMARC did not pass); dkim=none (no signatures found); dmarc=none policy.published-domain-policy=none policy.applied-disposition=none policy.evaluated-disposition=none (p=none,d=none,d.eval=none) policy.policy-from=p header.from=telka.sk; iprev=pass smtp.remote-ip=185.14.234.118 (tortuga.telka.sk); spf=pass smtp.mailfrom=marcel@telka.sk smtp.helo=tortuga.telka.sk; x-aligned-from=pass (Address match); x-me-sender=none; x-ptr=pass smtp.helo=tortuga.telka.sk policy.ptr=tortuga.telka.sk; x-return-mx=pass header.domain=telka.sk policy.is_org=yes (MX Records found: tortuga.telka.sk); x-return-mx=pass smtp.domain=telka.sk policy.is_org=yes (MX Records found: tortuga.telka.sk); x-tls=pass smtp.version=TLSv1.2 smtp.cipher=ECDHE-RSA-AES256-GCM-SHA384 smtp.bits=256/256; x-vs=clean score=-100 state=0 Authentication-Results: tb-mx0.topicbox.com; arc=none (no signatures found); bimi=skipped (DMARC did not pass); dkim=none (no signatures found); dmarc=none policy.published-domain-policy=none policy.applied-disposition=none policy.evaluated-disposition=none (p=none,d=none,d.eval=none) policy.policy-from=p header.from=telka.sk; iprev=pass smtp.remote-ip=185.14.234.118 (tortuga.telka.sk); spf=pass smtp.mailfrom=marcel@telka.sk smtp.helo=tortuga.telka.sk; x-aligned-from=pass (Address match); x-me-sender=none; x-ptr=pass smtp.helo=tortuga.telka.sk policy.ptr=tortuga.telka.sk; x-return-mx=pass header.domain=telka.sk policy.is_org=yes (MX Records found: tortuga.telka.sk); x-return-mx=pass smtp.domain=telka.sk policy.is_org=yes (MX Records found: tortuga.telka.sk); x-tls=pass smtp.version=TLSv1.2 smtp.cipher=ECDHE-RSA-AES256-GCM-SHA384 smtp.bits=256/256; x-vs=clean score=-100 state=0 X-ME-VSCause: gggruggvucftvghtrhhoucdtuddrgedvledrvdelkedgheejucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnh htshculddquddttddmnecujfgurhepfffhvffukfhfgggtuggjsehttdertddttddvnecu hfhrohhmpeforghrtggvlhcuvfgvlhhkrgcuoehmrghrtggvlhesthgvlhhkrgdrshhkqe enucggtffrrghtthgvrhhnpedvudeuteeiteeuveefudeigfetvddvgeegudeuteegieet hedutdelheduleduteenucffohhmrghinhepihhllhhumhhoshdrohhrghdpthgvlhhkrg drshhknecukfhppedukeehrddugedrvdefgedruddukeenucevlhhushhtvghrufhiiigv pedtnecurfgrrhgrmhepihhnvghtpedukeehrddugedrvdefgedruddukedphhgvlhhope htohhrthhughgrrdhtvghlkhgrrdhskhdpmhgrihhlfhhrohhmpeeomhgrrhgtvghlseht vghlkhgrrdhskheqpdhnsggprhgtphhtthhopedupdhrtghpthhtohepoeguvghvvghloh hpvghrsehlihhsthhsrdhilhhluhhmohhsrdhorhhgqe X-ME-VSScore: -100 X-ME-VSCategory: clean Received-SPF: pass (telka.sk: 185.14.234.118 is authorized to use 'marcel@telka.sk' in 'mfrom' identity (mechanism 'ip4:185.14.234.118' matched)) receiver=tb-mx0.topicbox.com; identity=mailfrom; envelope-from="marcel@telka.sk"; helo=tortuga.telka.sk; client-ip=185.14.234.118 Received: from tortuga.telka.sk (tortuga.telka.sk [185.14.234.118]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by tb-mx0.topicbox.com (Postfix) with ESMTPS for ; Thu, 6 Jun 2024 08:54:56 -0400 (EDT) (envelope-from marcel@telka.sk) Received: (qmail 17113 invoked from network); 6 Jun 2024 12:54:52 -0000 Received: from telcontar.in.telka.sk (HELO telcontar) (marcel@10.0.0.10) by tortuga.telka.sk with ESMTPSA (DHE-RSA-AES256-GCM-SHA384 encrypted); 6 Jun 2024 12:54:52 -0000 Date: Thu, 6 Jun 2024 14:54:51 +0200 From: Marcel Telka To: illumos-developer Subject: Re: [developer] Raw ethernet packets Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Topicbox-Policy-Reasoning: allow: sender is a member Topicbox-Message-UUID: 006cf444-2404-11ef-b08c-6a2a018c7b06 On Sun, Jun 02, 2024 at 11:05:40AM +0200, Marcel Telka wrote: > On Fri, May 31, 2024 at 10:43:03AM +0200, Marcel Telka wrote: > > I'm trying to send a raw ethernet packet from an userland application > > but all my attempts so far were unsuccessful. I basically tried two > > Attached is the testing program ethersend.c that uses both bpf and > socket approaches to send the raw ethernet frame. In both cases the > frame is silently dropped in mac_tx() because fe_tx_srs is NULL: > > https://src.illumos.org/source/xref/illumos-gate/usr/src/uts/common/io/mac/mac_client.c?r=119d61cc&mo=100885&fi=3519#3576 > > There is attached the ethersend.d dtrace script that shows the issue: > > # gcc -Wall -lsocket -o ethersend ethersend.c > # ./ethersend.d -c './ethersend e1000g0' 2>&1 | grep mac_tx > 1 -> mac_tx > 1 | mac_tx:entry 0 > 1 <- mac_tx 0 > 1 -> mac_tx > 1 | mac_tx:entry 0 > 1 <- mac_tx 0 > > Since something similar reportedly works on dilos (I assume it is a fork > of old illumos-gate) then it looks like the issue is in new illumos. > > I'll try to do some archaeology... The archeology revealed that the ethersend works on Solaris, but does not on work on even very old illumos: Solaris with the net0 network device: Solaris 11.1 FCS 10/2012 WORKS! Solaris 11.4 FCS 08/2018 WORKS! Below is illumos. All tests with e1000g0 device: oi_147 10/2010 DOES NOT WORK oi_151a8 08/2013 DOES NOT WORK hipster_20131023 10/2013 DOES NOT WORK dilos 2.0.2.48 11/2019 DOES NOT WORK I also tested up-to-date illumos (OpenIndiana) with vioif0 interface (qemu/kvm guest) and it does not work. Solaris apparently changed something since we parted and even there is the same hardware underneath (82540EM, VirtualBox) their networking stack looks differently (net0 vs. e1000g0). The ethersend simply works there. -- +-------------------------------------------+ | Marcel Telka e-mail: marcel@telka.sk | | homepage: http://telka.sk/ | +-------------------------------------------+