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:
Sylvain Rochet
2015-02-16 23:22:00 +01:00
parent cfe04d4453
commit 7132893863
3 changed files with 15 additions and 2 deletions

View File

@@ -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;

View File

@@ -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)