diff options
author | Simon Farnsworth <simon@farnz.org.uk> | 2015-03-01 10:54:39 +0000 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-03-02 00:17:31 -0500 |
commit | 287f3a943fef58c5c73e42545169443be379222f (patch) | |
tree | aefaf8eb2c42acc7091a76a2f152dc8a3f62b3b1 /include/linux/if_pppox.h | |
parent | 26caa3469a2de617d95c29371571a9585603a023 (diff) | |
download | op-kernel-dev-287f3a943fef58c5c73e42545169443be379222f.zip op-kernel-dev-287f3a943fef58c5c73e42545169443be379222f.tar.gz |
pppoe: Use workqueue to die properly when a PADT is received
When a PADT frame is received, the socket may not be in a good state to
close down the PPP interface. The current implementation handles this by
simply blocking all further PPP traffic, and hoping that the lack of traffic
will trigger the user to investigate.
Use schedule_work to get to a process context from which we clear down the
PPP interface, in a fashion analogous to hangup on a TTY-based PPP
interface. This causes pppd to disconnect immediately, and allows tools to
take immediate corrective action.
Note that pppd's rp_pppoe.so plugin has code in it to disable the session
when it disconnects; however, as a consequence of this patch, the session is
already disabled before rp_pppoe.so is asked to disable the session. The
result is a harmless error message:
Failed to disconnect PPPoE socket: 114 Operation already in progress
This message is safe to ignore, as long as the error is 114 Operation
already in progress; in that specific case, it means that the PPPoE session
has already been disabled before pppd tried to disable it.
Signed-off-by: Simon Farnsworth <simon@farnz.org.uk>
Tested-by: Dan Williams <dcbw@redhat.com>
Tested-by: Christoph Schulz <develop@kristov.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux/if_pppox.h')
-rw-r--r-- | include/linux/if_pppox.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/include/linux/if_pppox.h b/include/linux/if_pppox.h index aff7ad8..66a7d76 100644 --- a/include/linux/if_pppox.h +++ b/include/linux/if_pppox.h @@ -19,6 +19,7 @@ #include <linux/netdevice.h> #include <linux/ppp_channel.h> #include <linux/skbuff.h> +#include <linux/workqueue.h> #include <uapi/linux/if_pppox.h> static inline struct pppoe_hdr *pppoe_hdr(const struct sk_buff *skb) @@ -32,6 +33,7 @@ struct pppoe_opt { struct pppoe_addr pa; /* what this socket is bound to*/ struct sockaddr_pppox relay; /* what socket data will be relayed to (PPPoE relaying) */ + struct work_struct padt_work;/* Work item for handling PADT */ }; struct pptp_opt { |