tun/tap: Build fixes for tun add-on

This commit is contained in:
Alexander von Gluck IV
2019-04-17 14:12:59 +00:00
parent 23901a75de
commit 64948daae8
3 changed files with 7 additions and 4 deletions
+2
View File
@@ -12,5 +12,7 @@
#define IFT_LOOP 0x18
#define IFT_SLIP 0x1c
#define IFT_MODEM 0x30
#define IFT_TUN 0x40
#endif /* _NET_IF_TYPES_H */
@@ -3,4 +3,5 @@ SubDir HAIKU_TOP src add-ons kernel network devices ;
SubInclude HAIKU_TOP src add-ons kernel network devices dialup ;
SubInclude HAIKU_TOP src add-ons kernel network devices ethernet ;
SubInclude HAIKU_TOP src add-ons kernel network devices loopback ;
SubInclude HAIKU_TOP src add-ons kernel network devices tun ;
@@ -6,6 +6,7 @@
* Axel Dörfler, [email protected]
*/
#include <net_tun.h>
#include <net_buffer.h>
#include <net_device.h>
@@ -36,7 +37,6 @@ status_t
tun_init(const char *name, net_device **_device)
{
tun_device *device;
status_t status;
if (strncmp(name, "tun", 3)
&& strncmp(name, "tap", 3)
@@ -146,23 +146,23 @@ tun_std_ops(int32 op, ...)
{
switch (op) {
case B_MODULE_INIT:
{
status_t status = get_module(NET_STACK_MODULE_NAME,
(module_info **)&sStackModule);
if (status < B_OK)
return status;
status = get_module(NET_BUFFER_MODULE_NAME,
(module_info **)&gBufferModule);
if (status < B_OK) {
put_module(NET_STACK_MODULE_NAME);
return status;
}
return B_OK;
}
case B_MODULE_UNINIT:
put_module(NET_BUFFER_MODULE_NAME);
put_module(NET_STACK_MODULE_NAME);
return B_OK;
default:
return B_ERROR;
}