kernels/linux-2.4.0/drivers/net/pppoe.c
/************************************************************************
 *
 * Do the real work of receiving a PPPoE Session frame.
 *
 ***********************************************************************/
Do the real work of receiving a PPPoE Session frame.
Do the real work of receiving a PPPoE Session frame .
int pppoe_rcv_core(struct sock *sk, struct sk_buff *skb){
	struct pppox_opt  *po=sk->protinfo.pppox;
	struct pppox_opt *relay_po = NULL;
	if (sk->state & PPPOX_BOUND) {
		skb_pull(skb, sizeof(struct pppoe_hdr));
		ppp_input(&po->chan, skb);
	} else if( sk->state & PPPOX_RELAY ){
		relay_po = get_item_by_addr( &po->pppoe_relay );
		if( relay_po == NULL  ||
		    !( relay_po->sk->state & PPPOX_CONNECTED ) ){
			goto abort;
		}
		skb_pull(skb, sizeof(struct pppoe_hdr));
		if( !__pppoe_xmit( relay_po->sk , skb) ){
			goto abort;
		}
	} else {
		sock_queue_rcv_skb(sk, skb);
	}
	return 1;
abort:
	if(relay_po)
		sock_put(relay_po->sk);
	return 0;
}
int pppoe_rcv_core ( struct sock * sk , struct sk_buff * skb ) { struct pppox_opt * po = sk -> protinfo . pppox ; struct pppox_opt * relay_po = NULL ; if ( sk -> state & PPPOX_BOUND ) { skb_pull ( skb , sizeof ( struct pppoe_hdr ) ) ; ppp_input ( & po -> chan , skb ) ; } else if ( sk -> state & PPPOX_RELAY ) { relay_po = get_item_by_addr ( & po -> pppoe_relay ) ; if ( relay_po == NULL || ! ( relay_po -> sk -> state & PPPOX_CONNECTED ) ) { goto abort ; } skb_pull ( skb , sizeof ( struct pppoe_hdr ) ) ; if ( ! __pppoe_xmit ( relay_po -> sk , skb ) ) { goto abort ; } } else { sock_queue_rcv_skb ( sk , skb ) ; } return 1 ; abort : if ( relay_po ) sock_put ( relay_po -> sk ) ; return 0 ; }
Do the real work of receiving a PPPoE Session frame.
Do the real work of receiving a PPPoE Session frame .