Fixed the build of vfs_net_boot.cpp - I obviously messed up the full build I

thought I had done.
Of course, that wouldn't have happened if Ingo didn't break the network boot
with his netstack changes ;-)


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25058 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler
2008-04-19 19:28:34 +00:00
parent adebfe62cb
commit 49aadb1dac
+5 -21
View File
@@ -19,8 +19,6 @@
#include <disk_device_manager/KDiskDevice.h> #include <disk_device_manager/KDiskDevice.h>
#include <socket_interface.h>
#include <KPath.h> #include <KPath.h>
@@ -62,7 +60,7 @@ compare_partitions_net_devices(const void *_a, const void *_b)
class NetStackInitializer { class NetStackInitializer {
public: public:
NetStackInitializer(uint64 clientMAC, uint32 clientIP, uint32 netMask) NetStackInitializer(uint64 clientMAC, uint32 clientIP, uint32 netMask)
: fSocketModule(NULL), :
fSocket(-1), fSocket(-1),
fLinkSocket(-1), fLinkSocket(-1),
fClientMAC(clientMAC), fClientMAC(clientMAC),
@@ -81,25 +79,12 @@ public:
if (fLinkSocket >= 0) if (fLinkSocket >= 0)
close(fLinkSocket); close(fLinkSocket);
// put socket module
if (fSocketModule)
put_module(fSocketModule->info.name);
} }
status_t Init() status_t Init()
{ {
// get the socket module
status_t error = get_module(B_SOCKET_MODULE_NAME,
(module_info**)&fSocketModule);
if (error != B_OK) {
dprintf("NetStackInitializer: Failed to load socket module: %s\n",
strerror(error));
return error;
}
// open a control socket for playing with the stack // open a control socket for playing with the stack
fSocket = fSocketModule->socket(AF_INET, SOCK_DGRAM, 0); fSocket = socket(AF_INET, SOCK_DGRAM, 0);
if (fSocket < 0) { if (fSocket < 0) {
dprintf("NetStackInitializer: Failed to open socket: %s\n", dprintf("NetStackInitializer: Failed to open socket: %s\n",
strerror(errno)); strerror(errno));
@@ -107,7 +92,7 @@ public:
} }
// ... and a link level socket // ... and a link level socket
fLinkSocket = fSocketModule->socket(AF_LINK, SOCK_DGRAM, 0); fLinkSocket = socket(AF_LINK, SOCK_DGRAM, 0);
if (fLinkSocket < 0) { if (fLinkSocket < 0) {
dprintf("NetStackInitializer: Failed to open link level socket:" dprintf("NetStackInitializer: Failed to open link level socket:"
" %s\n", strerror(errno)); " %s\n", strerror(errno));
@@ -117,13 +102,13 @@ public:
// now iterate through the existing network devices // now iterate through the existing network devices
KPath path; KPath path;
error = path.SetTo("/dev/net"); status_t error = path.SetTo("/dev/net");
if (error != B_OK) if (error != B_OK)
return error; return error;
_ScanDevices(path); _ScanDevices(path);
return (fConfiguredInterface ? B_OK : B_ERROR); return fConfiguredInterface ? B_OK : B_ERROR;
} }
private: private:
@@ -299,7 +284,6 @@ private:
} }
private: private:
socket_module_info* fSocketModule;
int fSocket; int fSocket;
int fLinkSocket; int fLinkSocket;
uint64 fClientMAC; uint64 fClientMAC;