mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2025-01-15 22:49:16 +00:00
PPP, PPPoS, re-enabled PPPCTLG_FD
Found a fine way to get PPP fd without making this call crash for for PPPoE or PPPoL2TP.
This commit is contained in:
parent
cfe04d4453
commit
7132893863
@ -37,6 +37,9 @@
|
||||
#ifndef PPPOS_H
|
||||
#define PPPOS_H
|
||||
|
||||
#include "lwip/sys.h"
|
||||
#include "lwip/sio.h"
|
||||
|
||||
#include "ppp.h"
|
||||
#include "vj.h"
|
||||
|
||||
@ -61,6 +64,7 @@ ppp_pcb *ppp_over_serial_create(struct netif *pppif, sio_fd_t fd,
|
||||
void pppos_input(ppp_pcb *ppp, u_char* data, int len);
|
||||
|
||||
|
||||
sio_fd_t pppos_get_fd(pppos_pcb *pppos);
|
||||
void pppos_vjc_config(pppos_pcb *pppos, int vjcomp, int cidcomp, int maxcid);
|
||||
int pppos_vjc_comp(pppos_pcb *pppos, struct pbuf *pb);
|
||||
int pppos_vjc_uncomp(pppos_pcb *pppos, struct pbuf *pb);
|
||||
|
@ -773,10 +773,10 @@ ppp_ioctl(ppp_pcb *pcb, int cmd, void *arg)
|
||||
return PPPERR_PARAM;
|
||||
break;
|
||||
|
||||
#if 0/*PPPOS_SUPPORT*/
|
||||
#if PPPOS_SUPPORT
|
||||
case PPPCTLG_FD: /* Get the fd associated with the ppp */
|
||||
if (arg) {
|
||||
*(sio_fd_t *)arg = pcb->fd;
|
||||
*(sio_fd_t *)arg = pppos_get_fd((pppos_pcb*)pcb->link_ctx_cb);
|
||||
return PPPERR_NONE;
|
||||
}
|
||||
return PPPERR_PARAM;
|
||||
|
@ -743,6 +743,15 @@ drop:
|
||||
}
|
||||
#endif /* PPP_INPROC_MULTITHREADED */
|
||||
|
||||
sio_fd_t
|
||||
pppos_get_fd(pppos_pcb *pppos)
|
||||
{
|
||||
if (!pppos_exist(pppos)) {
|
||||
return 0;
|
||||
}
|
||||
return pppos->fd;
|
||||
}
|
||||
|
||||
#if VJ_SUPPORT
|
||||
void
|
||||
pppos_vjc_config(pppos_pcb *pppos, int vjcomp, int cidcomp, int maxcid)
|
||||
|
Loading…
Reference in New Issue
Block a user