mirror of
https://github.com/opnsense/src.git
synced 2026-05-28 04:12:45 -04:00
ifconfig: Fix default netmask calculation
Reported by: phk Reviewed by: emaste, kp MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D45570 (cherry picked from commit 8a9f0fa42b1c6cffd45459bb552e138083b00369)
This commit is contained in:
parent
5942bb31b9
commit
5734aad037
1 changed files with 4 additions and 4 deletions
|
|
@ -440,7 +440,7 @@ in_exec_nl(if_ctx *ctx, unsigned long action, void *data)
|
|||
static void
|
||||
in_setdefaultmask_nl(void)
|
||||
{
|
||||
struct in_px *px = sintab_nl[ADDR];
|
||||
struct in_px *px = sintab_nl[ADDR];
|
||||
|
||||
in_addr_t i = ntohl(px->addr.s_addr);
|
||||
|
||||
|
|
@ -451,11 +451,11 @@ in_setdefaultmask_nl(void)
|
|||
* we should return an error rather than warning.
|
||||
*/
|
||||
if (IN_CLASSA(i))
|
||||
px->plen = IN_CLASSA_NSHIFT;
|
||||
px->plen = 32 - IN_CLASSA_NSHIFT;
|
||||
else if (IN_CLASSB(i))
|
||||
px->plen = IN_CLASSB_NSHIFT;
|
||||
px->plen = 32 - IN_CLASSB_NSHIFT;
|
||||
else
|
||||
px->plen = IN_CLASSC_NSHIFT;
|
||||
px->plen = 32 - IN_CLASSC_NSHIFT;
|
||||
px->maskset = true;
|
||||
}
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Reference in a new issue