patch-2.4.1 linux/drivers/net/pppoe.c

Next file: linux/drivers/net/sunbmac.c
Previous file: linux/drivers/net/ppp_async.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.4.0/linux/drivers/net/pppoe.c linux/drivers/net/pppoe.c
@@ -5,23 +5,24 @@
  * PPPoE --- PPP over Ethernet (RFC 2516)
  *
  *
- * Version:    0.6.4
+ * Version:    0.6.5
  *
  * 030700 :     Fixed connect logic to allow for disconnect.
- * 270700 :	Fixed potential SMP problems; we must protect against 
- *		simultaneous invocation of ppp_input 
+ * 270700 :	Fixed potential SMP problems; we must protect against
+ *		simultaneous invocation of ppp_input
  *		and ppp_unregister_channel.
  * 040800 :	Respect reference count mechanisms on net-devices.
  * 200800 :     fix kfree(skb) in pppoe_rcv (acme)
  *		Module reference count is decremented in the right spot now,
- *		guards against sock_put not actually freeing the sk 
+ *		guards against sock_put not actually freeing the sk
  *		in pppoe_release.
  * 051000 :	Initialization cleanup.
  * 111100 :	Fix recvmsg.
+ * 050101 :	Fix PADT procesing.
  *
  * Author:	Michal Ostrowski <mostrows@styx.uwaterloo.ca>
  * Contributors:
- * 		Arnaldo Carvalho de Melo <acme@conectiva.com.br>
+ * 		Arnaldo Carvalho de Melo <acme@xconectiva.com.br>
  *
  * License:
  *		This program is free software; you can redistribute it and/or
@@ -110,7 +111,7 @@
 		hash ^= sid >> (i*PPPOE_HASH_BITS);
 
 	return hash & ( PPPOE_HASH_SIZE - 1 );
-}	
+}
 
 static struct pppox_opt *item_hash_table[PPPOE_HASH_SIZE] = { 0, };
 
@@ -238,7 +239,7 @@
 	struct net_device *dev = (struct net_device *) ptr;
 	struct pppox_opt *po = NULL;
 	int hash = 0;
-	
+
 	/* Only look at sockets that are using this specific device. */
 	switch (event) {
 	case NETDEV_CHANGEMTU:
@@ -255,13 +256,13 @@
 			po = item_hash_table[hash];
 			++hash;
 		}
-	
+
 		while (po && hash < PPPOE_HASH_SIZE){
 			if(po->pppoe_dev == dev){
 				lock_sock(po->sk);
 				if (po->sk->state & (PPPOX_CONNECTED|PPPOX_BOUND)){
 					pppox_unbind_sock(po->sk);
-				
+
 					dev_put(po->pppoe_dev);
 					po->pppoe_dev = NULL;
 
@@ -308,7 +309,7 @@
 
 	if (sk->state & PPPOX_BOUND) {
 		skb_pull(skb, sizeof(struct pppoe_hdr));
-		
+
 		ppp_input(&po->chan, skb);
 	} else if( sk->state & PPPOX_RELAY ){
 
@@ -318,7 +319,7 @@
 		    !( relay_po->sk->state & PPPOX_CONNECTED ) ){
 			goto abort;
 		}
-		
+
 		skb_pull(skb, sizeof(struct pppoe_hdr));
 		if( !__pppoe_xmit( relay_po->sk , skb) ){
 			goto abort;
@@ -369,7 +370,7 @@
 	}else{
 		ret = pppoe_rcv_core(sk, skb);
 	}
-	
+
 	bh_unlock_sock(sk);
 	sock_put(sk);
 	return ret;
@@ -412,13 +413,12 @@
 	po = get_item((unsigned long) ph->sid, skb->mac.ethernet->h_source);
 
 	if (!po)
-		goto abort_put;
+		goto abort;
 
 	sk = po->sk;
 
 	pppox_unbind_sock(sk);
 
- abort_put:
 	sock_put(sk);
  abort:
 	kfree_skb(skb);
@@ -466,9 +466,9 @@
 {
 	int error = 0;
 	struct sock *sk;
-	
+
 	MOD_INC_USE_COUNT;
-	
+
 	sk = sk_alloc(PF_PPPOX, GFP_KERNEL, 1);
 	if (!sk)
 		return -ENOMEM;
@@ -528,7 +528,7 @@
 	po = sk->protinfo.pppox;
 	if (po->pppoe_pa.sid)
 		delete_item(po->pppoe_pa.sid, po->pppoe_pa.remote);
-		
+
 	if (po->pppoe_dev)
 	    dev_put(po->pppoe_dev);
 
@@ -945,7 +945,7 @@
 	off_t begin = 0;
 	int size;
 	int i;
-	
+
 	len += sprintf(buffer,
 		       "Id       Address              Device\n");
 	pos = len;
@@ -1025,9 +1025,10 @@
  	int err = register_pppox_proto(PX_PROTO_OE, &pppoe_proto);
 
 	if (err == 0) {
-		printk(KERN_INFO "Registered PPPoE v0.6.4\n");
+		printk(KERN_INFO "Registered PPPoE v0.6.5\n");
 
 		dev_add_pack(&pppoes_ptype);
+		dev_add_pack(&pppoed_ptype);
 		register_netdevice_notifier(&pppoe_notifier);
 		proc_net_create("pppoe", 0, pppoe_proc_info);
 	}
@@ -1038,6 +1039,7 @@
 {
 	unregister_pppox_proto(PX_PROTO_OE);
 	dev_remove_pack(&pppoes_ptype);
+	dev_remove_pack(&pppoed_ptype);
 	unregister_netdevice_notifier(&pppoe_notifier);
 	proc_net_remove("pppoe");
 }

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)