Commit dfc0a507 authored by Michal Ostrowski's avatar Michal Ostrowski Committed by David S. Miller

[PPPOE]: Fix connect handling.

parent 27114580
...@@ -2028,9 +2028,11 @@ config PPPOE ...@@ -2028,9 +2028,11 @@ config PPPOE
help help
Support for PPP over Ethernet. Support for PPP over Ethernet.
This driver requires a specially patched pppd daemon. The patch to This driver requires the latest version of pppd from the CVS
pppd, along with binaries of a patched pppd package can be found at: repository at cvs.samba.org. Alternatively, see the
<http://www.shoshin.uwaterloo.ca/~mostrows/>. RoaringPenguin package (http://www.roaringpenguin.com/pppoe)
which contains instruction on how to use this driver (under
the heading "Kernel mode PPPoE").
config PPPOATM config PPPOATM
tristate "PPP over ATM" tristate "PPP over ATM"
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
* PPPoE --- PPP over Ethernet (RFC 2516) * PPPoE --- PPP over Ethernet (RFC 2516)
* *
* *
* Version: 0.6.11 * Version: 0.7.0
* *
* 220102 : Fix module use count on failure in pppoe_create, pppox_sk -acme * 220102 : Fix module use count on failure in pppoe_create, pppox_sk -acme
* 030700 : Fixed connect logic to allow for disconnect. * 030700 : Fixed connect logic to allow for disconnect.
...@@ -36,7 +36,8 @@ ...@@ -36,7 +36,8 @@
* from interrupts. Thus, we mark the socket as a ZOMBIE * from interrupts. Thus, we mark the socket as a ZOMBIE
* and do the unregistration later. * and do the unregistration later.
* 081002 : seq_file support for proc stuff -acme * 081002 : seq_file support for proc stuff -acme
* * 111602 : Merge all 2.4 fixes into 2.5/2.6 tree. Label 2.5/2.6
* as version 0.7. Spacing cleanup.
* Author: Michal Ostrowski <mostrows@speakeasy.net> * Author: Michal Ostrowski <mostrows@speakeasy.net>
* Contributors: * Contributors:
* Arnaldo Carvalho de Melo <acme@conectiva.com.br> * Arnaldo Carvalho de Melo <acme@conectiva.com.br>
...@@ -443,8 +444,10 @@ static int pppoe_disc_rcv(struct sk_buff *skb, ...@@ -443,8 +444,10 @@ static int pppoe_disc_rcv(struct sk_buff *skb,
* what kind of SKB it is during backlog rcv. * what kind of SKB it is during backlog rcv.
*/ */
if (sock_owned_by_user(sk) == 0) { if (sock_owned_by_user(sk) == 0) {
/* We're no longer connect at the PPPOE layer,
* and must wait for ppp channel to disconnect us.
*/
sk->state = PPPOX_ZOMBIE; sk->state = PPPOX_ZOMBIE;
pppox_unbind_sock(sk);
} }
bh_unlock_sock(sk); bh_unlock_sock(sk);
...@@ -583,8 +586,7 @@ int pppoe_connect(struct socket *sock, struct sockaddr *uservaddr, ...@@ -583,8 +586,7 @@ int pppoe_connect(struct socket *sock, struct sockaddr *uservaddr,
if ((sk->state & PPPOX_CONNECTED) && sp->sa_addr.pppoe.sid) if ((sk->state & PPPOX_CONNECTED) && sp->sa_addr.pppoe.sid)
goto end; goto end;
/* Check for already disconnected sockets, /* Check for already disconnected sockets, on attempts to disconnect */
on attempts to disconnect */
error = -EALREADY; error = -EALREADY;
if((sk->state & PPPOX_DEAD) && !sp->sa_addr.pppoe.sid ) if((sk->state & PPPOX_DEAD) && !sp->sa_addr.pppoe.sid )
goto end; goto end;
...@@ -596,6 +598,7 @@ int pppoe_connect(struct socket *sock, struct sockaddr *uservaddr, ...@@ -596,6 +598,7 @@ int pppoe_connect(struct socket *sock, struct sockaddr *uservaddr,
/* Delete the old binding */ /* Delete the old binding */
delete_item(po->pppoe_pa.sid,po->pppoe_pa.remote); delete_item(po->pppoe_pa.sid,po->pppoe_pa.remote);
if(po->pppoe_dev)
dev_put(po->pppoe_dev); dev_put(po->pppoe_dev);
memset(po, 0, sizeof(struct pppox_opt)); memset(po, 0, sizeof(struct pppox_opt));
......
...@@ -5,9 +5,9 @@ ...@@ -5,9 +5,9 @@
* PPPoE --- PPP over Ethernet (RFC 2516) * PPPoE --- PPP over Ethernet (RFC 2516)
* *
* *
* Version: 0.5.1 * Version: 0.5.2
* *
* Author: Michal Ostrowski <mostrows@styx.uwaterloo.ca> * Author: Michal Ostrowski <mostrows@speakeasy.net>
* *
* 051000 : Initialization cleanup * 051000 : Initialization cleanup
* *
...@@ -65,9 +65,9 @@ void pppox_unbind_sock(struct sock *sk) ...@@ -65,9 +65,9 @@ void pppox_unbind_sock(struct sock *sk)
{ {
/* Clear connection to ppp device, if attached. */ /* Clear connection to ppp device, if attached. */
if (sk->state & PPPOX_BOUND) { if (sk->state & (PPPOX_BOUND|PPPOX_ZOMBIE)) {
ppp_unregister_channel(&pppox_sk(sk)->chan); ppp_unregister_channel(&pppox_sk(sk)->chan);
sk->state &= ~PPPOX_BOUND; sk->state = PPPOX_DEAD;
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment