mirror of
https://git.savannah.nongnu.org/git/lwip.git
synced 2025-08-04 21:44:38 +08: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) {
|
switch(cmd) {
|
||||||
case PPPCTLG_UPSTATUS: /* Get the PPP up status. */
|
case PPPCTLG_UPSTATUS: /* Get the PPP up status. */
|
||||||
if (arg) {
|
if (!arg) {
|
||||||
*(int *)arg = (int)(pcb->if_up);
|
goto fail;
|
||||||
return PPPERR_NONE;
|
|
||||||
}
|
}
|
||||||
return PPPERR_PARAM;
|
*(int *)arg = (int)(pcb->if_up);
|
||||||
break;
|
return PPPERR_NONE;
|
||||||
|
|
||||||
case PPPCTLS_ERRCODE: /* Set the PPP error code. */
|
case PPPCTLS_ERRCODE: /* Set the PPP error code. */
|
||||||
if (arg) {
|
if (!arg) {
|
||||||
pcb->err_code = (u8_t)(*(int *)arg);
|
goto fail;
|
||||||
return PPPERR_NONE;
|
|
||||||
}
|
}
|
||||||
return PPPERR_PARAM;
|
pcb->err_code = (u8_t)(*(int *)arg);
|
||||||
break;
|
return PPPERR_NONE;
|
||||||
|
|
||||||
case PPPCTLG_ERRCODE: /* Get the PPP error code. */
|
case PPPCTLG_ERRCODE: /* Get the PPP error code. */
|
||||||
if (arg) {
|
if (!arg) {
|
||||||
*(int *)arg = (int)(pcb->err_code);
|
goto fail;
|
||||||
return PPPERR_NONE;
|
|
||||||
}
|
}
|
||||||
return PPPERR_PARAM;
|
*(int *)arg = (int)(pcb->err_code);
|
||||||
break;
|
return PPPERR_NONE;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
if (pcb->link_cb->ioctl) {
|
if (pcb->link_cb->ioctl) {
|
||||||
@ -374,6 +371,7 @@ ppp_ioctl(ppp_pcb *pcb, int cmd, void *arg)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fail:
|
||||||
return PPPERR_PARAM;
|
return PPPERR_PARAM;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user