kernel: backport all current pppoe kernel fixes to 3.18
[openwrt/openwrt.git] / target / linux / generic / patches-3.18 / 081-07-ppp-remove-PPPOX_ZOMBIE-socket-state.patch
1 From: Guillaume Nault <g.nault@alphalink.fr>
2 Date: Thu, 19 Nov 2015 12:53:21 +0100
3 Subject: [PATCH] ppp: remove PPPOX_ZOMBIE socket state
4
5 PPPOX_ZOMBIE is never set anymore.
6
7 Signed-off-by: Guillaume Nault <g.nault@alphalink.fr>
8 Signed-off-by: David S. Miller <davem@davemloft.net>
9 ---
10
11 --- a/drivers/net/ppp/pppoe.c
12 +++ b/drivers/net/ppp/pppoe.c
13 @@ -311,7 +311,7 @@ static void pppoe_flush_dev(struct net_d
14 lock_sock(sk);
15
16 if (po->pppoe_dev == dev &&
17 - sk->sk_state & (PPPOX_CONNECTED | PPPOX_BOUND | PPPOX_ZOMBIE)) {
18 + sk->sk_state & (PPPOX_CONNECTED | PPPOX_BOUND)) {
19 pppox_unbind_sock(sk);
20 sk->sk_state_change(sk);
21 po->pppoe_dev = NULL;
22 @@ -775,7 +775,7 @@ static int pppoe_ioctl(struct socket *so
23 struct pppox_sock *relay_po;
24
25 err = -EBUSY;
26 - if (sk->sk_state & (PPPOX_BOUND | PPPOX_ZOMBIE | PPPOX_DEAD))
27 + if (sk->sk_state & (PPPOX_BOUND | PPPOX_DEAD))
28 break;
29
30 err = -ENOTCONN;
31 --- a/drivers/net/ppp/pppox.c
32 +++ b/drivers/net/ppp/pppox.c
33 @@ -58,7 +58,7 @@ void pppox_unbind_sock(struct sock *sk)
34 {
35 /* Clear connection to ppp device, if attached. */
36
37 - if (sk->sk_state & (PPPOX_BOUND | PPPOX_CONNECTED | PPPOX_ZOMBIE)) {
38 + if (sk->sk_state & (PPPOX_BOUND | PPPOX_CONNECTED)) {
39 ppp_unregister_channel(&pppox_sk(sk)->chan);
40 sk->sk_state = PPPOX_DEAD;
41 }
42 --- a/include/linux/if_pppox.h
43 +++ b/include/linux/if_pppox.h
44 @@ -91,7 +91,6 @@ enum {
45 PPPOX_CONNECTED = 1, /* connection established ==TCP_ESTABLISHED */
46 PPPOX_BOUND = 2, /* bound to ppp device */
47 PPPOX_RELAY = 4, /* forwarding is enabled */
48 - PPPOX_ZOMBIE = 8, /* dead, but still bound to ppp device */
49 PPPOX_DEAD = 16 /* dead, useless, please clean me up!*/
50 };
51