On Mon, Dec 07, 2020 at 17:22:28 +0100, Guillaume Nault wrote:
> On Fri, Dec 04, 2020 at 04:36:55PM +0000, Tom Parkin wrote:
> > + case PPPIOCBRIDGECHAN:
> > + if (get_user(unit, p))
> > + break;
> > +
ppp_disconnect_channel.
* Improve docs update by including information on ioctl arguments
and error return codes.
Tom Parkin (2):
ppp: add PPPIOCBRIDGECHAN and PPPIOCUNBRIDGECHAN ioctls
docs: update ppp_generic.rst to document new ioctls
Documentation/networking/ppp_generi
Add documentation of the newly-added PPPIOCBRIDGECHAN and
PPPIOCUNBRIDGECHAN ioctls.
Signed-off-by: Tom Parkin
---
Documentation/networking/ppp_generic.rst | 16
1 file changed, 16 insertions(+)
diff --git a/Documentation/networking/ppp_generic.rst
b/Documentation/networking
rather than adding a new lock.
The 'upl' lock is used to protect the existing unit pointer. Since the
bridge effectively replaces the unit (they're mutually exclusive for a
channel) it makes coding easier to use the same lock to cover them
both.
Signed-off-by: Tom Park
On Thu, Dec 10, 2020 at 18:13:09 +0100, Guillaume Nault wrote:
> On Thu, Dec 10, 2020 at 03:50:56PM +0000, Tom Parkin wrote:
> > Following on from my previous RFC[1], this series adds two ioctl calls
> > to the ppp code to implement "channel bridging".
> >
> &
On Thu, Dec 10, 2020 at 14:21:34 -0800, David Miller wrote:
> From: Tom Parkin
> Date: Thu, 10 Dec 2020 17:16:45 +
>
> > On Thu, Dec 10, 2020 at 18:13:09 +0100, Guillaume Nault wrote:
> >> On Thu, Dec 10, 2020 at 03:50:56PM +, Tom Parkin wrote:
> >> &g
On Fri, Nov 27, 2020 at 20:31:34 +0100, Guillaume Nault wrote:
> On Thu, Nov 26, 2020 at 12:24:25PM +0000, Tom Parkin wrote:
> > This new ioctl pair allows two ppp channels to be bridged together:
> > frames arriving in one channel are transmitted in the other channel
>
27;t
part of a bridge: this better aligns with the return code from
ppp_disconnect_channel.
* Improve docs update by including information on ioctl arguments
and error return codes.
Tom Parkin (2):
ppp: add PPPIOCBRIDGECHAN and PPPIOCUNBRIDGECHAN ioctls
docs: update ppp_g
Add documentation of the newly-added PPPIOCBRIDGECHAN and
PPPIOCUNBRIDGECHAN ioctls.
Signed-off-by: Tom Parkin
---
Documentation/networking/ppp_generic.rst | 16
1 file changed, 16 insertions(+)
diff --git a/Documentation/networking/ppp_generic.rst
b/Documentation/networking
rather than adding a new lock.
The 'upl' lock is used to protect the existing unit pointer. Since the
bridge effectively replaces the unit (they're mutually exclusive for a
channel) it makes coding easier to use the same lock to cover them
both.
Signed-off-by: Tom Park
On Thu, Dec 03, 2020 at 01:23:18 +0100, Guillaume Nault wrote:
> On Tue, Dec 01, 2020 at 11:52:49AM +0000, Tom Parkin wrote:
> > +static int ppp_bridge_channels(struct channel *pch, struct channel *pchb)
> > +{
> > + write_lock_bh(&pch->upl);
> > + if (pch
part of a bridge: this better aligns with the return code from
ppp_disconnect_channel.
* Improve docs update by including information on ioctl arguments
and error return codes.
Tom Parkin (2):
ppp: add PPPIOCBRIDGECHAN and PPPIOCUNBRIDGECHAN ioctls
docs: update ppp_gen
rather than adding a new lock.
The 'upl' lock is used to protect the existing unit pointer. Since the
bridge effectively replaces the unit (they're mutually exclusive for a
channel) it makes coding easier to use the same lock to cover them
both.
Signed-off-by: Tom Park
Add documentation of the newly-added PPPIOCBRIDGECHAN and
PPPIOCUNBRIDGECHAN ioctls.
Signed-off-by: Tom Parkin
---
Documentation/networking/ppp_generic.rst | 16
1 file changed, 16 insertions(+)
diff --git a/Documentation/networking/ppp_generic.rst
b/Documentation/networking
On Tue, Nov 17, 2020 at 15:22:07 +0530, Siddhant Gupta wrote:
> Fix Column span alignment problem warnings in the file
>
Thanks for the patch, Siddhant.
Could you provide some information on how these warnings were
triggered? Using Sphinx 2.4.4 I can't reproduce any warnings for
l2tp.rst using
On Wed, Nov 18, 2020 at 16:44:11 +0530, siddhant gupta wrote:
> On Wed, 18 Nov 2020 at 15:53, Tom Parkin wrote:
> >
> > On Tue, Nov 17, 2020 at 15:22:07 +0530, Siddhant Gupta wrote:
> > > Fix Column span alignment problem warnings in the file
> > >
>
p_ac_pppoe_tests_2
Tom Parkin (2):
ppp: add PPPIOCBRIDGECHAN and PPPIOCUNBRIDGECHAN ioctls
docs: update ppp_generic.rst to document new ioctls
Documentation/networking/ppp_generic.rst | 9 ++
drivers/net/ppp/ppp_generic.c| 143 ++-
include/uapi
(rather than adding a new lock).
Order of lock acquisition is maintained: i.e. the channel 'upl' lock is
always acquired before 'downl' in code paths that need to hold both.
Signed-off-by: Tom Parkin
---
drivers/net/ppp/ppp_generic.c | 147 -
inclu
Add documentation of the newly-added PPPIOCBRIDGECHAN and
PPPIOCUNBRIDGECHAN ioctls.
Signed-off-by: Tom Parkin
---
Documentation/networking/ppp_generic.rst | 9 +
1 file changed, 9 insertions(+)
diff --git a/Documentation/networking/ppp_generic.rst
b/Documentation/networking
On Mon, Nov 09, 2020 at 23:51:53 +0100, Guillaume Nault wrote:
> > * I believe that the fact we're not explicitly locking anything in the
> >ppp_input path for access to the channel bridge field is OK since:
> >
> > - ppp_input is called from the socket backlog recv
> >
> > - ppp
On Tue, Nov 10, 2020 at 00:24:01 +0100, Guillaume Nault wrote:
> On Fri, Nov 06, 2020 at 06:16:46PM +0000, Tom Parkin wrote:
> > + case PPPIOCBRIDGECHAN:
> > + if (get_user(unit, p))
> > + break;
> > +
On Tue, Nov 10, 2020 at 10:28:34 +0100, Guillaume Nault wrote:
> On Mon, Nov 09, 2020 at 03:52:37PM -0800, Jakub Kicinski wrote:
> > On Fri, 6 Nov 2020 18:16:45 + Tom Parkin wrote:
> > > This small RFC series implements a suggestion from Guillaume Nault in
> > &
On Sun, Nov 15, 2020 at 12:59:59 +0100, Guillaume Nault wrote:
> On Tue, Nov 10, 2020 at 11:54:07AM +0000, Tom Parkin wrote:
> > On Mon, Nov 09, 2020 at 23:51:53 +0100, Guillaume Nault wrote:
> > > BTW, shouldn't we have an "UNBRIDGE" command to remove the
On Sun, Nov 15, 2020 at 17:28:38 +0100, Guillaume Nault wrote:
> On Tue, Nov 10, 2020 at 12:04:29PM +0000, Tom Parkin wrote:
> > On Tue, Nov 10, 2020 at 00:24:01 +0100, Guillaume Nault wrote:
> > > On Fri, Nov 06, 2020 at 06:16:46PM +
On Tue, Nov 10, 2020 at 08:47:40 -0800, Jakub Kicinski wrote:
> On Tue, 10 Nov 2020 10:28:34 +0100 Guillaume Nault wrote:
> > On Mon, Nov 09, 2020 at 03:52:37PM -0800, Jakub Kicinski wrote:
> > > On Fri, 6 Nov 2020 18:16:45 + Tom Parkin wrote:
> > > > This
underflow.
To avoid this, hold the ppp_mutex while calling ppp_unbridge_channels in
the shutdown path. This serialises the unbridge operation with any
concurrently executing ioctl.
Signed-off-by: Tom Parkin
---
drivers/net/ppp/ppp_generic.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/driv
On Thu, Dec 24, 2020 at 11:28:18 +0100, Guillaume Nault wrote:
> On Wed, Dec 23, 2020 at 06:47:30PM +0000, Tom Parkin wrote:
> > Channels are bridged using the PPPIOCBRIDGECHAN ioctl, which executes
> > with the ppp_mutex held.
> >
> > Unbridging may occur in two code
When setting up a channel bridge, ppp_bridge_channels sets the
pch->bridge field before taking the associated reference on the bridge
file instance.
This opens up a refcount underflow bug if ppp_bridge_channels called
via. iotcl runs concurrently with ppp_unbridge_channels executing via.
file rele
before it is unset by the error path, it will erroneously drop the
reference on the bridged channel and cause a refcount underflow.
To avoid this, ensure that ppp_bridge_channels holds a reference on
each channel in advance of setting the bridge pointers.
Signed-off-by: Tom Parkin
Fixes: 4cf4
On Fri, Jan 08, 2021 at 21:57:50 +0100, Guillaume Nault wrote:
> On Thu, Jan 07, 2021 at 06:13:15PM +0000, Tom Parkin wrote:
> > When setting up a channel bridge, ppp_bridge_channels sets the
> > pch->bridge field before taking the associated reference on the bridge
branch:
https://github.com/katalix/go-l2tp/tree/tp_002_pppoe_2
[3]. l2tp-ktest: a test suite for the Linux Kernel L2TP subsystem
https://github.com/katalix/l2tp-ktest
Tom Parkin (2):
ppp: add PPPIOCBRIDGECHAN ioctl
docs: update ppp_generic.rst to describe ioctl PPPIOCBRIDGECHAN
Documentation/netwo
This new ioctl allows two ppp channels to be bridged together: frames
arriving in one channel are transmitted in the other channel and vice
versa.
The practical use for this is primarily to support the L2TP Access
Concentrator use-case. The end-user session is presented as a ppp
channel (typicall
---
Documentation/networking/ppp_generic.rst | 5 +
1 file changed, 5 insertions(+)
diff --git a/Documentation/networking/ppp_generic.rst
b/Documentation/networking/ppp_generic.rst
index e60504377900..aea950ce953f 100644
--- a/Documentation/networking/ppp_generic.rst
+++ b/Documentation/netw
Hi Matthias,
Thanks for your patch!
On Fri, Feb 19, 2021 at 20:06:15 +0100, Matthias Schiffer wrote:
> Before commit 5ee759cda51b ("l2tp: use standard API for warning log
> messages"), it was possible for userspace applications to use their own
> control protocols on the backing sockets of an L2
On Sat, Feb 20, 2021 at 10:56:33 +0100, Matthias Schiffer wrote:
> On 2/19/21 9:12 PM, Tom Parkin wrote:
> > On Fri, Feb 19, 2021 at 20:06:15 +0100, Matthias Schiffer wrote:
> > > Before commit 5ee759cda51b ("l2tp: use standard API for warning log
> > > messages&
On Mon, Feb 22, 2021 at 17:40:16 +0100, Matthias Schiffer wrote:
> On 2/22/21 12:49 PM, Tom Parkin wrote:
> > On Sat, Feb 20, 2021 at 10:56:33 +0100, Matthias Schiffer wrote:
> > > On 2/19/21 9:12 PM, Tom Parkin wrote:
> > > > On Fri, Feb 19, 2021 at 20:06:15
On Mon, Feb 22, 2021 at 14:31:38 -0800, Jakub Kicinski wrote:
> On Mon, 22 Feb 2021 17:40:16 +0100 Matthias Schiffer wrote:
> > >> This will not be sufficient for my usecase: To stay compatible with older
> > >> versions of fastd, I can't set the T flag in the first packet of the
> > >> handshake,
On Tue, Apr 13, 2021 at 17:30:17 +, Gong, Sishuai wrote:
> Hi,
>
> We found a concurrency bug in linux 5.12-rc3 and we are able to reproduce it
> under x86. This bug happens when two l2tp functions l2tp_tunnel_register()
> and l2tp_xmit_core() are running in parallel. In general,
> l2tp_tu
t;ddp_crc != nskb->ddp_crc)
> + goto end;
> #endif
> }
> }
> diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c
> index 777306b5bc22..b114fc870513 100644
> --- a/net/ipv4/tcp_ipv4.c
> +++ b/net/ipv4/tcp_ipv4.c
> @@ -1810,6 +1810,9 @@ bool tcp_add_backlog(struct sock *sk, struct sk_buff
> *skb)
> TCP_SKB_CB(skb)->tcp_flags) & (TCPHDR_ECE | TCPHDR_CWR)) ||
> #ifdef CONFIG_TLS_DEVICE
> tail->decrypted != skb->decrypted ||
> +#endif
> +#ifdef CONFIG_TCP_DDP
> + tail->ddp_crc != skb->ddp_crc ||
> #endif
> thtail->doff != th->doff ||
> memcmp(thtail + 1, th + 1, hdrlen - sizeof(*th)))
> diff --git a/net/ipv4/tcp_offload.c b/net/ipv4/tcp_offload.c
> index e09147ac9a99..3ce196375d94 100644
> --- a/net/ipv4/tcp_offload.c
> +++ b/net/ipv4/tcp_offload.c
> @@ -262,6 +262,9 @@ struct sk_buff *tcp_gro_receive(struct list_head *head,
> struct sk_buff *skb)
> #ifdef CONFIG_TLS_DEVICE
> flush |= p->decrypted ^ skb->decrypted;
> #endif
> +#ifdef CONFIG_TCP_DDP
> + flush |= p->ddp_crc ^ skb->ddp_crc;
> +#endif
>
> if (flush || skb_gro_receive(p, skb)) {
> mss = 1;
> --
> 2.24.1
>
--
Tom Parkin
Katalix Systems Ltd
https://katalix.com
Catalysts for your Embedded Linux software development
signature.asc
Description: PGP signature
On Wed, Mar 03, 2021 at 16:50:49 +0100, Matthias Schiffer wrote:
> Commit 5ee759cda51b ("l2tp: use standard API for warning log messages")
> changed a number of warnings about invalid packets in the receive path
> so that they are always shown, instead of only when a special L2TP debug
> flag is s
Thanks for the report!
On Thu, Mar 11, 2021 at 20:34:44 +0800, lyl2...@mail.ustc.edu.cn wrote:
> File: drivers/net/ppp/ppp_generic.c
>
> In ppp_unregister_channel, pch could be freed in ppp_unbridge_channels()
> but after that pch is still in use. Inside the function ppp_unbridge_channels,
> if
On Fri, Mar 12, 2021 at 22:47:53 +0800, lyl2...@mail.ustc.edu.cn wrote:
>
>
>
> > -原始邮件-----
> > 发件人: "Tom Parkin"
> > 发送时间: 2021-03-12 18:12:58 (星期五)
> > 收件人: lyl2...@mail.ustc.edu.cn
> > 抄送: pau...@samba.org, da...@davemloft.net, linux
On Mon, Mar 15, 2021 at 13:18:24 +0100, Guillaume Nault wrote:
> On Fri, Mar 12, 2021 at 10:47:53PM +0800, lyl2...@mail.ustc.edu.cn wrote:
> >
> >
> >
> > > -原始邮件-
> > > 发件人: "Tom Parkin"
> > > 发送时间: 2021-03-12 18:12:
l2tp had logging to trace data frame receipt and transmission, including
code to dump packet contents. This was originally intended to aid
debugging of core l2tp packet handling, but is of limited use now that
code is stable.
Signed-off-by: Tom Parkin
---
net/l2tp/l2tp_core.c | 44
file net/l2tp/trace.h. When adding this file I followed the
example(s) of other tracepoint files in the net/ subtree since it seemed
preferable to adhere to the prevailing style rather than follow
checkpatch.pl's advice in this instance. If that's the wrong
approach please let me know.
Tom
Update l2tp.rst to:
* remove information about the obsolete debug flags and their use
* include information about tracepoints for l2tp
Signed-off-by: Tom Parkin
---
Documentation/networking/l2tp.rst | 37 ---
1 file changed, 14 insertions(+), 23 deletions(-)
diff
.
Signed-off-by: Tom Parkin
---
net/l2tp/l2tp_core.h | 6 +-
net/l2tp/trace.h | 196 +++
2 files changed, 200 insertions(+), 2 deletions(-)
diff --git a/net/l2tp/l2tp_core.h b/net/l2tp/l2tp_core.h
index 3468d6b177a0..835c4645a0ec 100644
--- a/net/l2tp
l2tp_ppp in particular had a lot of log messages for tracing
[get|set]sockopt calls. These aren't especially useful, so remove
these messages.
Several log messages flagging error conditions were logged using
l2tp_info: they're better off as l2tp_warn.
Signed-off-by: Tom Parkin
---
Add lifetime event tracing for tunnel and session instances, tracking
tunnel and session registration, deletion, and eventual freeing.
Port the data path sequence number debug logging to use trace points
rather than custom debug macros.
Signed-off-by: Tom Parkin
---
net/l2tp/l2tp_core.c | 83
apath warnings without
needing to tweak the debug flags setting for a given tunnel or session
instance.
Modify l2tp_warn callsites to use pr_warn_ratelimited instead for
unconditional output of warning messages.
Signed-off-by: Tom Parkin
---
net/l2tp/l2tp_core.c
All l2tp's informational and warning logging is now carried out using
standard kernel APIs.
Debugging information is now handled using tracepoints.
Now that no code is using the custom logging macros, remove them from
l2tp_core.h.
Signed-off-by: Tom Parkin
---
net/l2tp/l2tp_core.h
messages
handle the getting and setting of debug flags. To avoid userspace
breakage don't modify the API of these calls; simply ignore set
requests, and send dummy data for get requests.
Signed-off-by: Tom Parkin
---
include/uapi/linux/if_pppol2tp.h | 2 +-
include/uapi/linux/l2tp.h
The l2tp subsystem doesn't currently make use of tracepoints.
As a starting point for adding tracepoints, add skeleton infrastructure
for defining tracepoints for the subsystem, and for having them build
appropriately whether compiled into the kernel or built as a module.
Signed-off-by
On Fri, Aug 21, 2020 at 20:28:59 +0800, kernel test robot wrote:
> Hi Tom,
>
> Thank you for the patch! Perhaps something to improve:
>
[snip]
>
>net/l2tp/l2tp_core.c: In function 'l2tp_recv_common':
> >> net/l2tp/l2tp_core.c:663:14: warning: variable 'nr' set but not used
> >> [-Wunused-b
v1 -> v2
* Fix up a build warning found by the kernel test robot
Tom Parkin (9):
l2tp: don't log data frames
l2tp: remove noisy logging, use appropriate log levels
l2tp: use standard API for warning log messages
l2tp: add tracepoint infrastructure to core
l2tp: add tracepoint defi
All l2tp's informational and warning logging is now carried out using
standard kernel APIs.
Debugging information is now handled using tracepoints.
Now that no code is using the custom logging macros, remove them from
l2tp_core.h.
Signed-off-by: Tom Parkin
---
net/l2tp/l2tp_core.h
l2tp_ppp in particular had a lot of log messages for tracing
[get|set]sockopt calls. These aren't especially useful, so remove
these messages.
Several log messages flagging error conditions were logged using
l2tp_info: they're better off as l2tp_warn.
Signed-off-by: Tom Parkin
---
The l2tp subsystem doesn't currently make use of tracepoints.
As a starting point for adding tracepoints, add skeleton infrastructure
for defining tracepoints for the subsystem, and for having them build
appropriately whether compiled into the kernel or built as a module.
Signed-off-by
Add lifetime event tracing for tunnel and session instances, tracking
tunnel and session registration, deletion, and eventual freeing.
Port the data path sequence number debug logging to use trace points
rather than custom debug macros.
Signed-off-by: Tom Parkin
---
net/l2tp/l2tp_core.c | 83
l2tp had logging to trace data frame receipt and transmission, including
code to dump packet contents. This was originally intended to aid
debugging of core l2tp packet handling, but is of limited use now that
code is stable.
Signed-off-by: Tom Parkin
---
net/l2tp/l2tp_core.c | 58
apath warnings without
needing to tweak the debug flags setting for a given tunnel or session
instance.
Modify l2tp_warn callsites to use pr_warn_ratelimited instead for
unconditional output of warning messages.
Signed-off-by: Tom Parkin
---
net/l2tp/l2tp_core.c
Update l2tp.rst to:
* remove information about the obsolete debug flags and their use
* include information about tracepoints for l2tp
Signed-off-by: Tom Parkin
---
Documentation/networking/l2tp.rst | 37 ---
1 file changed, 14 insertions(+), 23 deletions(-)
diff
.
Signed-off-by: Tom Parkin
---
net/l2tp/l2tp_core.h | 6 +-
net/l2tp/trace.h | 196 +++
2 files changed, 200 insertions(+), 2 deletions(-)
diff --git a/net/l2tp/l2tp_core.h b/net/l2tp/l2tp_core.h
index 3468d6b177a0..835c4645a0ec 100644
--- a/net/l2tp
messages
handle the getting and setting of debug flags. To avoid userspace
breakage don't modify the API of these calls; simply ignore set
requests, and send dummy data for get requests.
Signed-off-by: Tom Parkin
---
include/uapi/linux/if_pppol2tp.h | 2 +-
include/uapi/linux/l2tp.h
egister_ops(L2TP_PWTYPE_ETH, &l2tp_eth_nl_cmd_ops);
> if (err)
> - goto out;
> -
> - err = register_pernet_device(&l2tp_eth_net_ops);
> - if (err)
> - goto out_unreg;
> + goto err;
>
> pr_info("L2TP ethernet pseudowire support (L2TPv3)\n");
>
> return 0;
>
> -out_unreg:
> - l2tp_nl_unregister_ops(L2TP_PWTYPE_ETH);
> -out:
> +err:
> return err;
> }
>
> static void __exit l2tp_eth_exit(void)
> {
> - unregister_pernet_device(&l2tp_eth_net_ops);
> l2tp_nl_unregister_ops(L2TP_PWTYPE_ETH);
> }
>
> --
> 2.14.2
>
--
Tom Parkin
Katalix Systems Ltd
http://www.katalix.com
Catalysts for your Embedded Linux software development
signature.asc
Description: Digital signature
Since the function is no longer used outside l2tp_core.c, remove the
"__" prefix since we don't need to indicate anything special about its
expected use to callers.
Signed-off-by: Tom Parkin
---
net/l2tp/l2tp_core.c | 57
net/l2tp/l2
nd we save on the
function pointer in the session structure).
This approach does mean dereferencing the parent tunnel structure in
order to determine the tunnel version, but we're doing that in the
transmit path in any case.
Signed-off-by: Tom Parkin
---
net/l2tp/l2tp_core.c | 10 --
ot be declared as
inline. Since the codepaths which take and drop tunnel and session
references are not directly in the datapath this shouldn't cause
performance issues.
Signed-off-by: Tom Parkin
---
net/l2tp/l2tp_core.c | 60 ++--
net/l2tp/l2tp_c
ort policy.
Change these exports to use EXPORT_SYMBOL_GPL for consistency with the
rest of l2tp.
Signed-off-by: Tom Parkin
---
net/l2tp/l2tp_core.c | 2 +-
net/l2tp/l2tp_ip.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/net/l2tp/l2tp_core.c b/net/l2tp/l2tp_core.c
index 39
pseudowires currently use l2tp_session_delete for
their implementation of that operation.
Signed-off-by: Tom Parkin
---
net/l2tp/l2tp_core.c| 9 ++---
net/l2tp/l2tp_core.h| 4 ++--
net/l2tp/l2tp_netlink.c | 2 +-
3 files changed, 5 insertions(+), 10 deletions(-)
diff --git a/net/l2tp
This short series makes some minor tidyup changes to the L2TP core API.
Tom Parkin (6):
l2tp: don't export __l2tp_session_unhash
l2tp: don't export tunnel and session free functions
l2tp: return void from l2tp_session_delete
l2tp: remove build_header callback in struct l2tp_sess
* Improve the description of the key l2tp subsystem data structures.
* Add high-level description of the main APIs for interacting with l2tp
core.
* Add documentation for the l2tp netlink session command callbacks.
* Document the session pseudowire callbacks.
Signed-off-by: Tom Parkin
On Tue, Jul 28, 2020 at 18:20:27 +0100, Tom Parkin wrote:
> This short series makes some minor tidyup changes to the L2TP core API.
I'm sorry, I forgot the "net-next" prefix in the subject line.
Please let me know if I should resubmit.
signature.asc
Description: PGP signature
On Tue, Jul 28, 2020 at 11:08:45 -0700, Joe Perches wrote:
> On Tue, 2020-07-28 at 09:21 -0700, Joe Perches wrote:
> > On Tue, 2020-07-21 at 18:32 +0100, Tom Parkin wrote:
> > > checkpatch warned about the L2TP_SKB_CB macro's use of its argument: add
> >
emove it to avoid the
warning.
Signed-off-by: Tom Parkin
---
net/l2tp/l2tp_core.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/net/l2tp/l2tp_core.c b/net/l2tp/l2tp_core.c
index a1ed8baa5aaa..6be3f2e69efd 100644
--- a/net/l2tp/l2tp_core.c
+++ b/net/l2tp/l2tp_core.c
@@ -1188,8 +1188,6 @@ s
ption, we can avoid doing more damage by simply
leaving the tunnel structure alone. If the tunnel refcount isn't
dropped when it should be, the tunnel instance will remain in the
kernel, resulting in the tunnel structure and socket leaking.
Signed-off-by: Tom Parkin
---
net/l2tp/l2tp_
pdate l2tp accordingly.
Signed-off-by: Tom Parkin
---
net/l2tp/l2tp_core.c| 20 ++--
net/l2tp/l2tp_debugfs.c | 12 ++--
net/l2tp/l2tp_ip.c | 2 +-
net/l2tp/l2tp_ip6.c | 2 +-
net/l2tp/l2tp_netlink.c | 23 +++
net/l2tp/l2tp_ppp.
.
Signed-off-by: Tom Parkin
---
net/l2tp/l2tp_netlink.c | 126 ++--
1 file changed, 70 insertions(+), 56 deletions(-)
diff --git a/net/l2tp/l2tp_netlink.c b/net/l2tp/l2tp_netlink.c
index ac5769ef8e20..8e03f2e367a0 100644
--- a/net/l2tp/l2tp_netlink.c
+++ b/net
Passing "sizeof(struct blah)" in kzalloc calls is less readable,
potentially prone to future bugs if the type of the pointer is changed,
and triggers checkpatch warnings.
Tweak the kzalloc calls in l2tp which use this form to avoid the
warning.
Signed-off-by: Tom Parkin
---
eturn NULL in
order to terminate the seq file processing in much the same way as we do
when reaching the end of tunnel/session instances to render.
Retain a WARN_ON to help trace possible bugs in this area.
Signed-off-by: Tom Parkin
---
net/l2tp/l2tp_ppp.c | 7 ++-
1 file changed, 6 inser
checkpatch warned about the L2TP_SKB_CB macro's use of its argument: add
braces to avoid the problem.
Signed-off-by: Tom Parkin
---
net/l2tp/l2tp_core.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/l2tp/l2tp_core.c b/net/l2tp/l2tp_core.c
index 177accb
Arguments should be aligned with the function call open parenthesis as
per checkpatch. Tweak some function calls which were not aligned
correctly.
Signed-off-by: Tom Parkin
---
net/l2tp/l2tp_core.c| 12 ++--
net/l2tp/l2tp_debugfs.c | 2 +-
net/l2tp/l2tp_ppp.c | 2 +-
3 files
checkpatch doesn't like multiple blank lines, or trailing blank lines at
the end of functions. They serve no useful purpose, so remove these from
the l2tp code.
Signed-off-by: Tom Parkin
---
net/l2tp/l2tp_core.c| 2 --
net/l2tp/l2tp_debugfs.c | 2 --
net/l2tp/l2tp_eth.c | 3 ---
t; flag to
protect against shutdown races.
While we're here, have l2tp_session_queue_purge return void rather than
an integer, since neither of the callsites checked the return value.
Signed-off-by: Tom Parkin
---
net/l2tp/l2tp_core.c | 9 ++---
1 file changed, 6 insertions(+), 3 del
l2tp_core has conditionally compiled code in l2tp_xmit_skb for IPv6
support. The structure of this code triggered a checkpatch warning
due to incorrect indentation.
Fix up the indentation to address the checkpatch warning.
Signed-off-by: Tom Parkin
---
net/l2tp/l2tp_core.c | 4 ++--
1 file
checkpatch warns about use of seq_printf where seq_puts would do.
Modify l2tp_debugfs accordingly.
Signed-off-by: Tom Parkin
---
net/l2tp/l2tp_debugfs.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/net/l2tp/l2tp_debugfs.c b/net/l2tp/l2tp_debugfs.c
index 70759acf2ae9
has conditionally compiled blocks to support IPv6.
Rather than embedding these directly into l2tp_nl_cmd_tunnel_create
(where it makes the code difficult to read and confuses checkpatch to
boot) split the handling of address-related attributes into a separate
function.
Signed-off-by: Tom Parkin
ing returned in
this scenario, but again, I prefer not to make such a change in this
patchset.
Tom Parkin (29):
l2tp: cleanup whitespace around operators
l2tp: tweak comment style for consistency
l2tp: add a blank line following declarations
l2tp: cleanup excessive blank lines
l2tp: clean
checkpatch warns about multiple assignments.
Update l2tp accordingly.
Signed-off-by: Tom Parkin
---
net/l2tp/l2tp_core.c | 6 +++---
net/l2tp/l2tp_ip.c | 12
net/l2tp/l2tp_ip6.c | 6 --
3 files changed, 15 insertions(+), 9 deletions(-)
diff --git a/net/l2tp/l2tp_core.c b
ional
compilation can be handled more cleanly.
Signed-off-by: Tom Parkin
---
net/l2tp/l2tp_debugfs.c | 38 +-
1 file changed, 21 insertions(+), 17 deletions(-)
diff --git a/net/l2tp/l2tp_debugfs.c b/net/l2tp/l2tp_debugfs.c
index 800a17b988be..d8cddc82da4b 100644
---
he reference count on the suspect session structure.
In the worst case scenario this results in a memory leak, which is
preferable to a crash.
Convert these uses of BUG_ON to WARN_ON accordingly.
Signed-off-by: Tom Parkin
---
net/l2tp/l2tp_ppp.c | 13 +
1 file changed, 9 insertions
l2tp_dfs_seq_start had a BUG_ON to catch a possible programming error in
l2tp_dfs_seq_open.
Since we can easily bail out of l2tp_dfs_seq_start, prefer to do that
and flag the error with a WARN_ON rather than crashing the kernel.
Signed-off-by: Tom Parkin
---
net/l2tp/l2tp_debugfs.c | 9
-off-by: Tom Parkin
---
net/l2tp/l2tp_core.c | 6 --
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/net/l2tp/l2tp_core.c b/net/l2tp/l2tp_core.c
index 7218925edbf2..ef393604e66e 100644
--- a/net/l2tp/l2tp_core.c
+++ b/net/l2tp/l2tp_core.c
@@ -1398,7 +1398,8 @@ static int
Use BIT(x) rather than (1<
---
net/l2tp/l2tp_core.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/net/l2tp/l2tp_core.h b/net/l2tp/l2tp_core.h
index f23b3ff7..2d2dd219a176 100644
--- a/net/l2tp/l2tp_core.h
+++ b/net/l2tp/l2tp_core.h
@@ -21,11 +21,11 @@
/* Per tunnel
Reported by checkpatch:
"WARNING: function definition argument 'struct sock *'
should also have an identifier name"
Add an identifier name to help document the prototype.
Signed-off-by: Tom Parkin
---
net/l2tp/l2tp_core.h | 2 +-
1 file changed, 1 inse
e code was incorrect and confusing. Fix up the comment accordingly.
Signed-off-by: Tom Parkin
---
net/l2tp/l2tp_core.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/l2tp/l2tp_core.c b/net/l2tp/l2tp_core.c
index 182386ad20e2..177accb01993 100644
--- a/net/l2tp/l2tp_core.c
+++
exceed 80
characters in width in some places.
Signed-off-by: Tom Parkin
---
net/l2tp/l2tp_netlink.c | 71 +
net/l2tp/l2tp_ppp.c | 6 ++--
2 files changed, 32 insertions(+), 45 deletions(-)
diff --git a/net/l2tp/l2tp_netlink.c b/net/l2tp/l2tp_netlink.c
checkpatch likes an empty line following declarations, which gives a
visual prompt for where logic begins in a given block.
Add blank lines in l2tp code to adhere to this guideline.
Signed-off-by: Tom Parkin
---
net/l2tp/l2tp_core.c| 2 ++
net/l2tp/l2tp_ip.c | 2 ++
net/l2tp
l2tp_session_free is only called by l2tp_session_dec_refcount when the
reference count reaches zero, so it's of limited value to validate the
reference count value in l2tp_session_free itself.
Signed-off-by: Tom Parkin
---
net/l2tp/l2tp_core.c | 2 --
1 file changed, 2 deletions(-)
diff
These checks are all simple and don't benefit from extra braces to
clarify intent. Remove them for easier-reading code.
Signed-off-by: Tom Parkin
---
net/l2tp/l2tp_core.c | 6 +++---
net/l2tp/l2tp_ppp.c | 23 +--
2 files changed, 12 insertions(+), 17 deletions(-)
1 - 100 of 156 matches
Mail list logo