Received: by 2002:a05:6358:53a8:b0:117:f937:c515 with SMTP id z40csp5099349rwe; Tue, 18 Apr 2023 01:56:10 -0700 (PDT) X-Google-Smtp-Source: AKy350bgZvhIC0MowIhs2z46oODjmbNuS4MvB6xJJQIevgUvLmq3PBS7ZkwvI7UG8kTiIxgqtSaC X-Received: by 2002:a05:6a20:440c:b0:ef:7b11:3ad with SMTP id ce12-20020a056a20440c00b000ef7b1103admr9243256pzb.33.1681808170632; Tue, 18 Apr 2023 01:56:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681808170; cv=none; d=google.com; s=arc-20160816; b=E4PBeEWVeSRy2nvBjMuyTUTknDA43/QUJ+1496mK2wyPyeumuXMBnHc2hYXxRHd700 mWgNoddR4tV445FeYwe+e3vvAah9bm8zJ9iE2pPShtu9zOkdYwBdq6W6L7i+yqUSIKkV fdE/5Fx8oOuewmgV6KzEB72s3sMHeDBxlPx83s3Rnnw8Ee0As17XIUa7gvzIF/LgqezI j7RiGU7UqdEsXfPhPpLKx+bdFYoq3QP5KFnmQmBkspbXgP2p7xRVG0rxYKrx0xYJCqsD K9CIadTwiNXevOO0I6CiuqfWDBlmIr+CjIuW0bXMLq2CECTtn4tCQmCcGb9g+7q9Yf+c szog== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:organization:in-reply-to :content-disposition:mime-version:references:mail-followup-to :message-id:subject:cc:to:from:date; bh=eLMiUy9qk4xn6Jzc0svKWgKau3f5rPF7tOcgRcK+t34=; b=nNrM/Ym9OGpXdWk40s/P2ET9U0DzFih2l9NlBbBaC2x9DdII6x9Q/Svj2VPzPwcv9o OqSaYjn4o6dSc0KPo2t6KKBFEs+22dFZoPg7Lcz40LhtHNNIkaYx76dvMCQabI4jcGeT rhKC1pAaZ8O8ZzyoNOhCjXEDMJ2SJ9+Aqq8a7kSPfLHrhvdpxnNYn+piss2wr0OcBBFZ KKaI6GnjHAhTaEIDdGLbXk6tFbPc/J2bGHw2pkxoFBp8mU+metkblmwn4HWvBmjf9LP1 Uh3Xdir3q16R4qh60/+/TC6+zfUi/mosdmZs0S2OFJhiqWxQOny62nxdfAOERu/3eqAh OYkA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q21-20020a632a15000000b00517b6ea5131si1156192pgq.271.2023.04.18.01.55.58; Tue, 18 Apr 2023 01:56:10 -0700 (PDT) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230448AbjDRIx3 (ORCPT + 99 others); Tue, 18 Apr 2023 04:53:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33276 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230389AbjDRIx2 (ORCPT ); Tue, 18 Apr 2023 04:53:28 -0400 Received: from sonata.ens-lyon.org (domu-toccata.ens-lyon.fr [140.77.166.138]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D4A5D3C30; Tue, 18 Apr 2023 01:53:26 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by sonata.ens-lyon.org (Postfix) with ESMTP id D35BE20176; Tue, 18 Apr 2023 10:53:24 +0200 (CEST) Received: from sonata.ens-lyon.org ([127.0.0.1]) by localhost (sonata.ens-lyon.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ifhotv0kCr-0; Tue, 18 Apr 2023 10:53:24 +0200 (CEST) Received: from begin.home (apoitiers-658-1-118-253.w92-162.abo.wanadoo.fr [92.162.65.253]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by sonata.ens-lyon.org (Postfix) with ESMTPSA id 36FB720155; Tue, 18 Apr 2023 10:53:24 +0200 (CEST) Received: from samy by begin.home with local (Exim 4.96) (envelope-from ) id 1poh5X-00BML6-2I; Tue, 18 Apr 2023 10:53:23 +0200 Date: Tue, 18 Apr 2023 10:53:23 +0200 From: Samuel Thibault To: Guillaume Nault Cc: James Chapman , tparkin@katalix.com, edumazet@google.com, davem@davemloft.net, kuba@kernel.org, pabeni@redhat.com, corbet@lwn.net, netdev@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] PPPoL2TP: Add more code snippets Message-ID: <20230418085323.h6xij7w6d2o4kxxi@begin> Mail-Followup-To: Samuel Thibault , Guillaume Nault , James Chapman , tparkin@katalix.com, edumazet@google.com, davem@davemloft.net, kuba@kernel.org, pabeni@redhat.com, corbet@lwn.net, netdev@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org References: <20230416220704.xqk4q6uwjbujnqpv@begin> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Organization: I am not organized User-Agent: NeoMutt/20170609 (1.8.3) X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE, SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 Guillaume Nault, le mar. 18 avril 2023 10:34:03 +0200, a ecrit: > On Mon, Apr 17, 2023 at 12:07:04AM +0200, Samuel Thibault wrote: > > sax.sa_family = AF_PPPOX; > > sax.sa_protocol = PX_PROTO_OL2TP; > > sax.pppol2tp.fd = tunnel_fd; > > @@ -406,12 +407,64 @@ Sample userspace code: > > /* session_fd is the fd of the session's PPPoL2TP socket. > > * tunnel_fd is the fd of the tunnel UDP / L2TPIP socket. > > */ > > - fd = connect(session_fd, (struct sockaddr *)&sax, sizeof(sax)); > > - if (fd < 0 ) { > > + ret = connect(session_fd, (struct sockaddr *)&sax, sizeof(sax)); > > + if (ret < 0 ) { > > Now you also need to close session_fd. ? No, we need it for PPPIOCGCHAN, and also PPPIOCGL2TPSTATS. I'll put return session_fd instead. > > +The ppp interface can then be configured as usual with SIOCSIFMTU, > > +SIOCSIFADDR, SIOCSIFDSTADDR, SIOCSIFNETMASK, and activated by setting IFF_UP > > +with SIOCSIFFLAGS > > + > > + - Tunnel switching is supported by bridging channels:: > > This is a PPP feature not an L2TP one. > > PPPIOCBRIDGECHAN's description > belongs to Documentation/networking/ppp_generic.rst, where it's already > documented. Yes but that's hard to find out when you're looking from the L2TP end. > If necessary, you can link to ppp_generic.rst here. > > Also, calling this feature 'tunnel switching' is misleading. That's how I have seen it is called in L2TP jargon. Samuel