Received: by 2002:a05:6358:a55:b0:ec:fcf4:3ecf with SMTP id 21csp584709rwb; Thu, 12 Jan 2023 09:36:55 -0800 (PST) X-Google-Smtp-Source: AMrXdXvTZVSIyFly5yCvminVfabd3tQk8jypO3lzQewequcm02YbmZnBA22jTJ/sL+ohN8aEdwmV X-Received: by 2002:aa7:cb4b:0:b0:491:3a5c:6e5 with SMTP id w11-20020aa7cb4b000000b004913a5c06e5mr31585232edt.1.1673545015022; Thu, 12 Jan 2023 09:36:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673545014; cv=none; d=google.com; s=arc-20160816; b=UfduuqZP4XCPFsjK+LcZiFG5aCP3oxHKlNhDeqLt98UutE4nEWHPvkXN7GPYSizg4s z0UpAPZva0eMHG7s+1toySZgt2GrDt6LwuBlYFEb2oHlBDwdRSUQhJEXzahAbGECTwis S9P/5y4SfjogRq2FzKSBGAhpllsYxgDMTSbkSBDwG5npF/lIYRSXHycg5ei0qwioZ5QN v3p4l3mcKuJ5rcB8RTpqGE68J+Vpl1fhpI4zjMNHNJrnjgx9YlJYBX6YBhB5DDiAvcyG peVvcrdt5mW86wBMuSqilc1mGNX4M6a2V+ktubizPhlrUol7+dO1Xdkxh6S0Cyrd66ux bO5Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=H/5UvQLcE+gE2UM//QPrFVxXIrmQLZMv6C1MkrKpG4o=; b=JLSIq5nwsavN480+zg5ezvhlCJ0Aw06+7uBdrRSKiPNT/W6sj52Trx5AL4erny59zP k3VHZrfWYN8KhKl3ThnY30vB210uYrzUzmb/yOn6xVwsk2gdx9nIdZ3UAVqLH/YcSZO1 cixc/0KCdvFFdjHIOsphT4q30qzyJCwf4RQtZQI3+LJoR9lKtCZkv8JApGeOVJKnBubZ IyBQ7XlxGRjDaLVWLzOqU2KD+yk0IbVNMZIBrFWUFxgWzQYroDYWWGbpf1/3uG5+/EOb NnHuceOUKNqykdjufLXV4JjnVaRt2kH5+0SYU6dxVken7UDYOXxa8tgqm4ia0K9wIVzq WoQA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@netgeek.ovh header.s=default header.b=lMWweUsh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=netgeek.ovh Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w20-20020a056402269400b0044f2fb68fe6si21036296edd.495.2023.01.12.09.36.42; Thu, 12 Jan 2023 09:36:54 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@netgeek.ovh header.s=default header.b=lMWweUsh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=netgeek.ovh Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232421AbjALQZE (ORCPT + 50 others); Thu, 12 Jan 2023 11:25:04 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32934 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232994AbjALQYd (ORCPT ); Thu, 12 Jan 2023 11:24:33 -0500 Received: from netgeek.ovh (ks.netgeek.ovh [IPv6:2001:41d0:a:271e::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4368518B00; Thu, 12 Jan 2023 08:21:09 -0800 (PST) Received: from quaddy.sgn (unknown [IPv6:2a01:cb19:83f8:d500:21d:60ff:fedb:90ab]) by ks.netgeek.ovh (Postfix) with ESMTPSA id 9E77C152; Thu, 12 Jan 2023 17:21:08 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=netgeek.ovh; s=default; t=1673540468; bh=7JnEnSkCbq3mxD56KLZrGRldLIdlGmpduZ9f8M+VY8E=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=lMWweUshTT9AjcVX7IJQen/0GjWFm+1C3pS2EG06O58Hx87+Lq1OWIldzyyNtOoV3 DXLMa8rBMcYCwZ2anG8QiBR3Qc3JYnvJy5rwMp09zTHDbQGnmgoejD40yR1mJ97nE7 CuD3VmS8WvyBnSj1OiZX3Ic5mhOTdkQc6lSL1jy4ryYgpC/6DafPwhSLMddqphbvh1 fvTpO1VqTtP8GQM96zCFu0LPfwky2L9VnMLfC/Fdyt8ZpHnlCcD8VU2OP0uOWAXDRZ 9vvivreT/i/Jp+fEuThqXFbg3YreY/zaAjtu6XZnjNs/L5sR3lXsCckLhM/SaQywr4 qv7jRaM+H47jA== Date: Thu, 12 Jan 2023 17:22:34 +0100 From: =?iso-8859-1?Q?Herv=E9?= Boisse To: Paolo Abeni Cc: "David S. Miller" , Eric Dumazet , Jakub Kicinski , admin@netgeek.ovh, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH net 2/2] net/af_packet: fix tx skb network header on SOCK_RAW sockets over VLAN device Message-ID: References: <20230110191725.22675-1-admin@netgeek.ovh> <20230110191725.22675-2-admin@netgeek.ovh> <47d9b00c664dbaabd8921a47257ffc3b7c5a1325.camel@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <47d9b00c664dbaabd8921a47257ffc3b7c5a1325.camel@redhat.com> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jan 12, 2023 at 04:47:38PM +0100, Paolo Abeni wrote: > I understand, thanks. Still is not clear why the user-space application > would attach to dummy0.832 instead of dummy0. > > With your patch the filter will match, but the dhcp packet will reach > the wire untagged, so the app will behave exactly as it would do > if/when attached to dummy0. > > To me it looks like the dhcp client has a bad configuration (wrong > interface) and these patches address the issue in the wrong place > (inside the kernel). No, the packet will actually reach the wire as a properly tagged 802.1Q frame. For devices that do not support VLAN offloading (such as dummy but also the network card I am using), the kernel adds the tag itself in software before transmitting the packet to the real device. You can verify this with a capture using tcpdump/wireshark on dummy0 versus dummy0.832. That's why dhclient has to send its packets over dummy0.832 and not dummy0. The same will happen on a real device. I checked on real hardware, with two boxes and their network cards connected through a cable. If dhclient is started directly on the first box real device (eth0), the frame is received untagged by the second box, as intended. But, if dhclient is started on top of the VLAN device (eth0.832), the second box receives a properly tagged frame. Herv?