xburst: Remove unmaintained target
[openwrt/staging/jogo.git] / target / linux / generic / pending-3.18 / 081-06-ppp-don-t-set-sk_state-to-PPPOX_ZOMBIE-in-pppoe_disc.patch
1 From: Guillaume Nault <g.nault@alphalink.fr>
2 Date: Thu, 19 Nov 2015 12:52:56 +0100
3 Subject: [PATCH] ppp: don't set sk_state to PPPOX_ZOMBIE in pppoe_disc_rcv()
4
5 Since 287f3a943fef ("pppoe: Use workqueue to die properly when a PADT
6 is received"), pppoe_disc_rcv() disconnects the socket by scheduling
7 pppoe_unbind_sock_work(). This is enough to stop socket transmission
8 and makes the PPPOX_ZOMBIE state uncessary.
9
10 Signed-off-by: Guillaume Nault <g.nault@alphalink.fr>
11 Signed-off-by: David S. Miller <davem@davemloft.net>
12 ---
13
14 --- a/drivers/net/ppp/pppoe.c
15 +++ b/drivers/net/ppp/pppoe.c
16 @@ -500,27 +500,9 @@ static int pppoe_disc_rcv(struct sk_buff
17
18 pn = pppoe_pernet(dev_net(dev));
19 po = get_item(pn, ph->sid, eth_hdr(skb)->h_source, dev->ifindex);
20 - if (po) {
21 - struct sock *sk = sk_pppox(po);
22 -
23 - bh_lock_sock(sk);
24 -
25 - /* If the user has locked the socket, just ignore
26 - * the packet. With the way two rcv protocols hook into
27 - * one socket family type, we cannot (easily) distinguish
28 - * what kind of SKB it is during backlog rcv.
29 - */
30 - if (sock_owned_by_user(sk) == 0) {
31 - /* We're no longer connect at the PPPOE layer,
32 - * and must wait for ppp channel to disconnect us.
33 - */
34 - sk->sk_state = PPPOX_ZOMBIE;
35 - }
36 -
37 - bh_unlock_sock(sk);
38 + if (po)
39 if (!schedule_work(&po->proto.pppoe.padt_work))
40 - sock_put(sk);
41 - }
42 + sock_put(sk_pppox(po));
43
44 abort:
45 kfree_skb(skb);