kernels/linux-2.4.0/drivers/net/pppoe.c
/************************************************************************
 *
 * Receive wrapper called in BH context.
 *
 ***********************************************************************/
Receive wrapper called in BH context.
Receive wrapper called in BH context .
static int pppoe_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 ;
	int ret;
	po = get_item((unsigned long) ph->sid, skb->mac.ethernet->h_source);
	if(!po){
		kfree_skb(skb);
		return 0;
	}
	sk = po->sk;
        bh_lock_sock(sk);
	if( sk->lock.users != 0 ){
		sk_add_backlog( sk, skb);
		ret = 1;
	}else{
		ret = pppoe_rcv_core(sk, skb);
	}
	bh_unlock_sock(sk);
	sock_put(sk);
	return ret;
}
static int pppoe_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 ; int ret ; po = get_item ( ( unsigned long ) ph -> sid , skb -> mac . ethernet -> h_source ) ; if ( ! po ) { kfree_skb ( skb ) ; return 0 ; } sk = po -> sk ; bh_lock_sock ( sk ) ; if ( sk -> lock . users != 0 ) { sk_add_backlog ( sk , skb ) ; ret = 1 ; } else { ret = pppoe_rcv_core ( sk , skb ) ; } bh_unlock_sock ( sk ) ; sock_put ( sk ) ; return ret ; }
Receive wrapper called in BH context.
Receive wrapper called in BH context .
/* Socket state is unknown, must put skb into backlog. */