lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date: Thu, 15 Feb 2024 13:49:42 +0100
From: Paolo Abeni <pabeni@...hat.com>
To: Samuel Thibault <samuel.thibault@...-lyon.org>, James Chapman
	 <jchapman@...alix.com>, tparkin@...alix.com, edumazet@...gle.com, 
	gnault@...hat.com
Cc: davem@...emloft.net, kuba@...nel.org, corbet@....net,
 netdev@...r.kernel.org,  linux-doc@...r.kernel.org,
 linux-kernel@...r.kernel.org
Subject: Re: [PATCHv5] PPPoL2TP: Add more code snippets

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


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ