reduced call stack by one when receiving a PPPoE disc packet

This commit is contained in:
Sylvain Rochet 2012-07-15 15:12:40 +02:00
parent 91af8878e1
commit 936c6c0d5c

View File

@ -112,9 +112,6 @@
static char pppoe_error_tmp[PPPOE_ERRORSTRING_LEN]; static char pppoe_error_tmp[PPPOE_ERRORSTRING_LEN];
/* input routines */
static void pppoe_dispatch_disc_pkt(struct netif *, struct pbuf *);
/* management routines */ /* management routines */
static int pppoe_do_disconnect(struct pppoe_softc *); static int pppoe_do_disconnect(struct pppoe_softc *);
static void pppoe_abort_connect(struct pppoe_softc *); static void pppoe_abort_connect(struct pppoe_softc *);
@ -273,8 +270,8 @@ pppoe_linkstatus_up(struct pppoe_softc *sc)
} }
/* analyze and handle a single received packet while not in session state */ /* analyze and handle a single received packet while not in session state */
static void void
pppoe_dispatch_disc_pkt(struct netif *netif, struct pbuf *pb) pppoe_disc_input(struct netif *netif, struct pbuf *pb)
{ {
u16_t tag, len; u16_t tag, len;
u16_t session, plen; u16_t session, plen;
@ -292,6 +289,12 @@ pppoe_dispatch_disc_pkt(struct netif *netif, struct pbuf *pb)
int off, err; int off, err;
struct eth_hdr *ethhdr; struct eth_hdr *ethhdr;
/* don't do anything if there is not a single PPPoE instance */
if (pppoe_softc_list == NULL) {
pbuf_free(pb);
return;
}
pb = ppp_singlebuf(pb); pb = ppp_singlebuf(pb);
strcpy(devname, "pppoe"); /* as long as we don't know which instance */ strcpy(devname, "pppoe"); /* as long as we don't know which instance */
@ -534,18 +537,6 @@ done:
return; return;
} }
/* FIXME: is this shit really necessary, why we don't call pppoe_dispatch_disc_pkt() instead !? */
void
pppoe_disc_input(struct netif *netif, struct pbuf *p)
{
/* avoid error messages if there is not a single pppoe instance */
if (pppoe_softc_list != NULL) {
pppoe_dispatch_disc_pkt(netif, p);
} else {
pbuf_free(p);
}
}
void void
pppoe_data_input(struct netif *netif, struct pbuf *pb) pppoe_data_input(struct netif *netif, struct pbuf *pb)
{ {