mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2025-03-13 07:14:31 +00:00
PPP, CORE, beautified ppp_ioctl()
This commit is contained in:
parent
729e24da78
commit
759d11ce1a
@ -345,28 +345,25 @@ ppp_ioctl(ppp_pcb *pcb, int cmd, void *arg)
|
||||
|
||||
switch(cmd) {
|
||||
case PPPCTLG_UPSTATUS: /* Get the PPP up status. */
|
||||
if (arg) {
|
||||
if (!arg) {
|
||||
goto fail;
|
||||
}
|
||||
*(int *)arg = (int)(pcb->if_up);
|
||||
return PPPERR_NONE;
|
||||
}
|
||||
return PPPERR_PARAM;
|
||||
break;
|
||||
|
||||
case PPPCTLS_ERRCODE: /* Set the PPP error code. */
|
||||
if (arg) {
|
||||
if (!arg) {
|
||||
goto fail;
|
||||
}
|
||||
pcb->err_code = (u8_t)(*(int *)arg);
|
||||
return PPPERR_NONE;
|
||||
}
|
||||
return PPPERR_PARAM;
|
||||
break;
|
||||
|
||||
case PPPCTLG_ERRCODE: /* Get the PPP error code. */
|
||||
if (arg) {
|
||||
if (!arg) {
|
||||
goto fail;
|
||||
}
|
||||
*(int *)arg = (int)(pcb->err_code);
|
||||
return PPPERR_NONE;
|
||||
}
|
||||
return PPPERR_PARAM;
|
||||
break;
|
||||
|
||||
default:
|
||||
if (pcb->link_cb->ioctl) {
|
||||
@ -374,6 +371,7 @@ ppp_ioctl(ppp_pcb *pcb, int cmd, void *arg)
|
||||
}
|
||||
}
|
||||
|
||||
fail:
|
||||
return PPPERR_PARAM;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user