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:
parent
84011d2394
commit
1550ecf11a
@ -329,17 +329,16 @@ NetBootMethod::Init()
|
||||
|
||||
if (fBootVolume.FindInt32("net mask", (int32*)&netMask) != B_OK) {
|
||||
// choose default netmask depending on the class of the address
|
||||
in_addr_t net = htonl(clientIP);
|
||||
if (IN_CLASSA(net)
|
||||
|| (ntohl(net) >> IN_CLASSA_NSHIFT) == IN_LOOPBACKNET) {
|
||||
if (IN_CLASSA(clientIP)
|
||||
|| (clientIP >> IN_CLASSA_NSHIFT) == IN_LOOPBACKNET) {
|
||||
// class A, or loopback
|
||||
netMask = ntohl(IN_CLASSA_NET);
|
||||
} else if (IN_CLASSB(net)) {
|
||||
netMask = IN_CLASSA_NET;
|
||||
} else if (IN_CLASSB(clientIP)) {
|
||||
// class B
|
||||
netMask = ntohl(IN_CLASSB_NET);
|
||||
netMask = IN_CLASSB_NET;
|
||||
} else {
|
||||
// class C and rest
|
||||
netMask = ntohl(IN_CLASSC_NET);
|
||||
netMask = IN_CLASSC_NET;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user