mirror of
https://git.savannah.nongnu.org/git/lwip.git
synced 2026-08-09 17:13:49 +08:00
Cleanly separate the portability file inet.h and its contents from the stack: moved htonX- functions to def.h (and the new def.c - they are not ipv4 dependent), let inet.h depend on ip_addr.h and not the other way round. This fixes bug #28732.
This commit is contained in:
@@ -82,6 +82,8 @@
|
||||
#include "cbcp.h"
|
||||
#endif /* CBCP_SUPPORT */
|
||||
|
||||
#include "lwip/inet.h"
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#if 0 /* UNUSED */
|
||||
|
||||
@@ -63,6 +63,8 @@
|
||||
#include "vj.h"
|
||||
#include "ipcp.h"
|
||||
|
||||
#include "lwip/inet.h"
|
||||
|
||||
#include <string.h>
|
||||
|
||||
/* #define OLD_CI_ADDRS 1 */ /* Support deprecated address negotiation. */
|
||||
@@ -166,8 +168,6 @@ static void ipcp_clear_addrs (int);
|
||||
(x) == CONFNAK ? "NAK" : "REJ")
|
||||
|
||||
|
||||
#define inet_ntoa(addr) ip_ntoa(((struct ip_addr*)&(addr)))
|
||||
|
||||
/*
|
||||
* ipcp_init - Initialize IPCP.
|
||||
*/
|
||||
|
||||
@@ -1249,12 +1249,12 @@ GetMask(u32_t addr)
|
||||
u32_t mask, nmask;
|
||||
|
||||
htonl(addr);
|
||||
if (IN_CLASSA(addr)) { /* determine network mask for address class */
|
||||
nmask = IN_CLASSA_NET;
|
||||
} else if (IN_CLASSB(addr)) {
|
||||
nmask = IN_CLASSB_NET;
|
||||
if (IP_CLASSA(addr)) { /* determine network mask for address class */
|
||||
nmask = IP_CLASSA_NET;
|
||||
} else if (IP_CLASSB(addr)) {
|
||||
nmask = IP_CLASSB_NET;
|
||||
} else {
|
||||
nmask = IN_CLASSC_NET;
|
||||
nmask = IP_CLASSC_NET;
|
||||
}
|
||||
|
||||
/* class D nets are disallowed by bad_ip_adrs */
|
||||
|
||||
Reference in New Issue
Block a user