diff --git a/sys/net/if_spppsubr.c b/sys/net/if_spppsubr.c --- a/sys/net/if_spppsubr.c +++ b/sys/net/if_spppsubr.c @@ -5044,10 +5044,9 @@ static int sppp_params(struct sppp *sp, u_long cmd, void *data) { - u_long subcmd; struct ifreq *ifr = (struct ifreq *)data; struct spppreq *spr; - int rv = 0; + int rv; if ((spr = malloc(sizeof(struct spppreq), M_TEMP, M_NOWAIT)) == NULL) return (EAGAIN); @@ -5056,7 +5055,7 @@ * Check the cmd word first before attempting to fetch all the * data. */ - rv = fueword(ifr_data_get_ptr(ifr), &subcmd); + rv = fuword32(ifr_data_get_ptr(ifr)); if (rv == -1) { rv = EFAULT; goto quit; @@ -5067,8 +5066,9 @@ goto quit; } - switch (subcmd) { - case (u_long)SPPPIOGDEFS: + MPASS(rv == spr->cmd); + switch (spr->cmd) { + case (intptr_t)SPPPIOGDEFS: if (cmd != SIOCGIFGENERIC) { rv = EINVAL; break; @@ -5103,7 +5103,7 @@ sizeof(struct spppreq)); break; - case (u_long)SPPPIOSDEFS: + case (intptr_t)SPPPIOSDEFS: if (cmd != SIOCSIFGENERIC) { rv = EINVAL; break;