kernels/linux-2.4.0/drivers/net/pppoe.c
/************************************************************************
 *
 * Receive a PPPoE Discovery frame.
 * This is solely for detection of PADT frames
 *
 ***********************************************************************/
Receive a PPPoE Discovery frame.
This is solely for detection of PADT frames
Receive a PPPoE Discovery frame . This is solely for detection of PADT frames
static int pppoe_disc_rcv(struct sk_buff *skb,
			  struct net_device *dev,
			  struct packet_type *pt)
{
	struct pppoe_hdr *ph = (struct pppoe_hdr *) skb->nh.raw;
	struct pppox_opt *po;
	struct sock *sk = NULL;
	if (ph->code != PADT_CODE)
		goto abort;
	po = get_item((unsigned long) ph->sid, skb->mac.ethernet->h_source);
	if (!po)
		goto abort_put;
	sk = po->sk;
	pppox_unbind_sock(sk);
 abort_put:
	sock_put(sk);
 abort:
	kfree_skb(skb);
	return 0;
}
static int pppoe_disc_rcv ( struct sk_buff * skb , struct net_device * dev , struct packet_type * pt ) { struct pppoe_hdr * ph = ( struct pppoe_hdr * ) skb -> nh . raw ; struct pppox_opt * po ; struct sock * sk = NULL ; if ( ph -> code != PADT_CODE ) goto abort ; po = get_item ( ( unsigned long ) ph -> sid , skb -> mac . ethernet -> h_source ) ; if ( ! po ) goto abort_put ; sk = po -> sk ; pppox_unbind_sock ( sk ) ; abort_put : sock_put ( sk ) ; abort : kfree_skb ( skb ) ; return 0 ; }
Receive a PPPoE Discovery frame.
Receive a PPPoE Discovery frame .