The IN_CLASS* macros use host byte order.
This fixes netmask and broadcast ip for PXE booting. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39928 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -329,17 +329,16 @@ NetBootMethod::Init()
|
|||||||
|
|
||||||
if (fBootVolume.FindInt32("net mask", (int32*)&netMask) != B_OK) {
|
if (fBootVolume.FindInt32("net mask", (int32*)&netMask) != B_OK) {
|
||||||
// choose default netmask depending on the class of the address
|
// choose default netmask depending on the class of the address
|
||||||
in_addr_t net = htonl(clientIP);
|
if (IN_CLASSA(clientIP)
|
||||||
if (IN_CLASSA(net)
|
|| (clientIP >> IN_CLASSA_NSHIFT) == IN_LOOPBACKNET) {
|
||||||
|| (ntohl(net) >> IN_CLASSA_NSHIFT) == IN_LOOPBACKNET) {
|
|
||||||
// class A, or loopback
|
// class A, or loopback
|
||||||
netMask = ntohl(IN_CLASSA_NET);
|
netMask = IN_CLASSA_NET;
|
||||||
} else if (IN_CLASSB(net)) {
|
} else if (IN_CLASSB(clientIP)) {
|
||||||
// class B
|
// class B
|
||||||
netMask = ntohl(IN_CLASSB_NET);
|
netMask = IN_CLASSB_NET;
|
||||||
} else {
|
} else {
|
||||||
// class C and rest
|
// class C and rest
|
||||||
netMask = ntohl(IN_CLASSC_NET);
|
netMask = IN_CLASSC_NET;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user