mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Paolo Abeni <pabeni@redhat.com>
To: Samuel Thibault <samuel.thibault@ens-lyon.org>,
	James Chapman <jchapman@katalix.com>,
	tparkin@katalix.com, edumazet@google.com,  gnault@redhat.com
Cc: davem@davemloft.net, kuba@kernel.org, corbet@lwn.net,
	netdev@vger.kernel.org,  linux-doc@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCHv5] PPPoL2TP: Add more code snippets
Date: Thu, 15 Feb 2024 13:49:42 +0100	[thread overview]
Message-ID: <7dd8ed05495a8f9e1dad7f27e5186f62c8c0b730.camel@redhat.com> (raw)
In-Reply-To: <20240214012102.dsdgcdgvwgfabzdi@begin>

On Wed, 2024-02-14 at 02:21 +0100, Samuel Thibault wrote:
[...]
> +  - Bridging L2TP sessions which have PPP pseudowire types (this is also called
> +    L2TP tunnel switching or L2TP multihop) is supported by bridging the PPP
> +    channels of the two L2TP sessions to be bridged::
> +
> +        /* Input: the session PPPoX data sockets `session_fd1` and `session_fd2`
> +         * which were created as described further above.
> +         */
> +
> +        int ppp_chan_fd;
> +        int chindx1;
> +        int chindx2;
> +        int ret;
> +
> +        ret = ioctl(session_fd1, PPPIOCGCHAN, &chindx1);
> +        if (ret < 0)
> +                return -errno;
> +
> +        ret = ioctl(session_fd2, PPPIOCGCHAN, &chindx2);
> +        if (ret < 0)
> +                return -errno;
> +
> +        ppp_chan_fd = open("/dev/ppp", O_RDWR);
> +        if (ppp_chan_fd < 0)
> +                return -errno;
> +
> +        ret = ioctl(ppp_chan_fd, PPPIOCATTCHAN, &chindx1);
> +        if (ret < 0) {
> +                close(ppp_chan_fd);
> +                return -errno;
> +        }
> +
> +        ret = ioctl(ppp_chan_fd, PPPIOCBRIDGECHAN, &chindx2);
> +        close(ppp_chan_fd);
> +        if (ret < 0)
> +                return -errno;
> +
>          return 0;
>  
> +It can be noted that when bridging PPP channels, the PPP session is not locally terminated, and no local PPP interface is created.  PPP frames arriving on one channel are directly passed to the other channel, and vice versa.

You need to format the above sentence to fit a more reasonable line
length.

Thanks!

Paolo


      parent reply	other threads:[~2024-02-15 12:49 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-14  1:21 Samuel Thibault
2024-02-14  9:34 ` Tom Parkin
2024-02-15 12:49 ` Paolo Abeni [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7dd8ed05495a8f9e1dad7f27e5186f62c8c0b730.camel@redhat.com \
    --to=pabeni@redhat.com \
    --cc=corbet@lwn.net \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=gnault@redhat.com \
    --cc=jchapman@katalix.com \
    --cc=kuba@kernel.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=samuel.thibault@ens-lyon.org \
    --cc=tparkin@katalix.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®