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 B2A13193CB80 for ; Fri, 31 May 2024 09:33:10 -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 959C6429FDA; Fri, 31 May 2024 09:33:10 -0400 ARC-Seal: i=1; a=rsa-sha256; cv=none; d=topicbox.com; s=arcseal; t= 1717162390; b=Eca6lPTbvXmu9T5n2CL2dRWdXvDgejf4CD6hDcGLuDDkNBloou SD/2Tt9uSLD2mssMogUBp0XVHKFNxbhmVKIs4zQWldwvB9+VaEKqDDk79M2q0LQp Af5FfvVxjHOQZXRjnyEUQ2br6lB7/TRDOYUCQ1qAxRutGtFg1GdMV3BUfLbFE61X GeCgWFpKQNG8gojrxkAnaVP+10Im6wI1rqyOuI0q8X31lEg/kE7UekGzOZLkhDPa g95Ukifo27Zk3fXvdUpEA48lBwYFmjsUYUF15ZB+/jiUQR8RtmF67XqPphErG348 f1OUKuNl5EZQE+IgyfqzAKR1qT01ZRSOWU7Q== 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=1717162390; bh=BY348oFnhG2oeCL+2fzU+CVh7rzmJTaxOGUtVwdZwew=; b=NxtmzQXq2F6W 80aMZ2766RG9Tll9UJLbrBQwTOMJQwqOGaUjG8ov2WiSnSVjxFd6YZyfBLUpd6Dg NMHMxEreILOrpk4ZMw8FRYAgllMMQheH/8R4FgWZwOGnIjoSuixgKOSGyxicpmRU 1Cn71Wl3TaYWUyeeb81CA2X4PWKzkr3tZBVD3dv0vWKCA4ql0E3JiACMDBTJUR4Z oBqHj7G/Vdjyi4sFzroDT/aowt7p0GoojWI9+oJt2NYP5zm7s/WPAMmYGKhlCjqb Ji56My5bbGy6Yk5UZw7nnxpCczYm/aX36TSUW/YfO9BaN/sr5610bVbbzLWo/Nzi BxOU2J6R6Q== 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: gggruggvucftvghtrhhoucdtuddrgedvledrvdekiedgieegucetufdoteggodetrfdotf 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 ; Fri, 31 May 2024 09:33:08 -0400 (EDT) (envelope-from marcel@telka.sk) Received: (qmail 22594 invoked from network); 31 May 2024 13:33:06 -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); 31 May 2024 13:33:06 -0000 Date: Fri, 31 May 2024 15:33:05 +0200 From: Marcel Telka To: illumos-developer Subject: Re: [developer] Raw ethernet packets Message-ID: References: <202405311423.04150.denis@tambov.ru> <202405311518.23145.denis@tambov.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202405311518.23145.denis@tambov.ru> Topicbox-Policy-Reasoning: allow: sender is a member Topicbox-Message-UUID: 562cb16e-1f52-11ef-8b6b-dd97048c7b06 On Fri, May 31, 2024 at 03:18:23PM +0300, Denis Kozadaev wrote: > On Friday 31 May 2024 15:07:13 Marcel Telka wrote: > > On Fri, May 31, 2024 at 02:23:04PM +0300, Denis Kozadaev wrote: > > > The send() function can be used only when the socket is in a connected > > > state. (c) manual page at https://illumos.org/man/3SOCKET/send > > > Use sendto(), Marcel. > > > > sendto(s, buf, sizeof buf - 1, 0, NULL, 0); > > > > gives the same result: succeeds, but no packet on the network. > it is because > send(sock, buf, len, flags) > could be equivalent to > sendto(sock, buf, len, flags, NULL, 0) > it depend of the implementation > You should specify a real address for sendto() > and yes, the packet and the address have duplicate of this data. I tried to add this: llp.sll_pkttype = PACKET_BROADCAST; llp.sll_hatype = ARPHRD_ETHER; llp.sll_halen = 6; llp.sll_addr[0] = 0xff; llp.sll_addr[1] = 0xff; llp.sll_addr[2] = 0xff; llp.sll_addr[3] = 0xff; llp.sll_addr[4] = 0xff; llp.sll_addr[5] = 0xff; sendto(s, buf, sizeof buf - 1, 0, (struct sockaddr *)&llp, sizeof llp); And the result is stil the same: the function succeeded, no packet on the network. -- +-------------------------------------------+ | Marcel Telka e-mail: marcel@telka.sk | | homepage: http://telka.sk/ | +-------------------------------------------+