mirror of
https://github.com/vanhoefm/fragattacks.git
synced 2025-01-29 08:14:02 -05:00
vlan: Clean up netlink vs. ioctl API implementation
Move the ioctl-based VLAN implementation to a separate file to avoid need for conditional blocks within vlan_ioctl.c. This removes the internal CONFIG_VLAN_NETLINK define, i.e., this is now used only in build configuration (.config) to select whether to include the vlan_util.c (netlink) or vlan_ioctl.c (ioctl) implementation of the functions. Signed-off-by: Jouni Malinen <j@w1.fi>
This commit is contained in:
parent
cb38bc886e
commit
84d6755108
@ -176,11 +176,15 @@ L_CFLAGS += -DCONFIG_NO_VLAN
|
|||||||
else
|
else
|
||||||
OBJS += src/ap/vlan_init.c
|
OBJS += src/ap/vlan_init.c
|
||||||
OBJS += src/ap/vlan.c
|
OBJS += src/ap/vlan.c
|
||||||
ifdef CONFIG_VLAN_NETLINK
|
|
||||||
ifdef CONFIG_FULL_DYNAMIC_VLAN
|
ifdef CONFIG_FULL_DYNAMIC_VLAN
|
||||||
|
# Define CONFIG_FULL_DYNAMIC_VLAN to have hostapd manipulate bridges
|
||||||
|
# and VLAN interfaces for the VLAN feature.
|
||||||
|
L_CFLAGS += -DCONFIG_FULL_DYNAMIC_VLAN
|
||||||
|
ifdef CONFIG_VLAN_NETLINK
|
||||||
OBJS += src/ap/vlan_util.c
|
OBJS += src/ap/vlan_util.c
|
||||||
|
else
|
||||||
|
OBJS += src/ap/vlan_ioctl.c
|
||||||
endif
|
endif
|
||||||
L_CFLAGS += -DCONFIG_VLAN_NETLINK
|
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
@ -869,12 +873,6 @@ ifdef CONFIG_DRIVER_RADIUS_ACL
|
|||||||
L_CFLAGS += -DCONFIG_DRIVER_RADIUS_ACL
|
L_CFLAGS += -DCONFIG_DRIVER_RADIUS_ACL
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifdef CONFIG_FULL_DYNAMIC_VLAN
|
|
||||||
# define CONFIG_FULL_DYNAMIC_VLAN to have hostapd manipulate bridges
|
|
||||||
# and vlan interfaces for the vlan feature.
|
|
||||||
L_CFLAGS += -DCONFIG_FULL_DYNAMIC_VLAN
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifdef NEED_BASE64
|
ifdef NEED_BASE64
|
||||||
OBJS += src/utils/base64.c
|
OBJS += src/utils/base64.c
|
||||||
endif
|
endif
|
||||||
|
@ -195,11 +195,15 @@ CFLAGS += -DCONFIG_NO_VLAN
|
|||||||
else
|
else
|
||||||
OBJS += ../src/ap/vlan_init.o
|
OBJS += ../src/ap/vlan_init.o
|
||||||
OBJS += ../src/ap/vlan.o
|
OBJS += ../src/ap/vlan.o
|
||||||
ifdef CONFIG_VLAN_NETLINK
|
|
||||||
ifdef CONFIG_FULL_DYNAMIC_VLAN
|
ifdef CONFIG_FULL_DYNAMIC_VLAN
|
||||||
|
# Define CONFIG_FULL_DYNAMIC_VLAN to have hostapd manipulate bridges
|
||||||
|
# and VLAN interfaces for the VLAN feature.
|
||||||
|
CFLAGS += -DCONFIG_FULL_DYNAMIC_VLAN
|
||||||
|
ifdef CONFIG_VLAN_NETLINK
|
||||||
OBJS += ../src/ap/vlan_util.o
|
OBJS += ../src/ap/vlan_util.o
|
||||||
|
else
|
||||||
|
OBJS += ../src/ap/vlan_ioctl.o
|
||||||
endif
|
endif
|
||||||
CFLAGS += -DCONFIG_VLAN_NETLINK
|
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
@ -907,12 +911,6 @@ ifdef CONFIG_DRIVER_RADIUS_ACL
|
|||||||
CFLAGS += -DCONFIG_DRIVER_RADIUS_ACL
|
CFLAGS += -DCONFIG_DRIVER_RADIUS_ACL
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifdef CONFIG_FULL_DYNAMIC_VLAN
|
|
||||||
# define CONFIG_FULL_DYNAMIC_VLAN to have hostapd manipulate bridges
|
|
||||||
# and vlan interfaces for the vlan feature.
|
|
||||||
CFLAGS += -DCONFIG_FULL_DYNAMIC_VLAN
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifdef NEED_BASE64
|
ifdef NEED_BASE64
|
||||||
OBJS += ../src/utils/base64.o
|
OBJS += ../src/utils/base64.o
|
||||||
endif
|
endif
|
||||||
|
@ -21,7 +21,6 @@
|
|||||||
#include <net/if.h>
|
#include <net/if.h>
|
||||||
#include <sys/ioctl.h>
|
#include <sys/ioctl.h>
|
||||||
#ifdef CONFIG_FULL_DYNAMIC_VLAN
|
#ifdef CONFIG_FULL_DYNAMIC_VLAN
|
||||||
#include <linux/sockios.h>
|
|
||||||
#include <linux/if_vlan.h>
|
#include <linux/if_vlan.h>
|
||||||
#include <linux/if_bridge.h>
|
#include <linux/if_bridge.h>
|
||||||
#endif /* CONFIG_FULL_DYNAMIC_VLAN */
|
#endif /* CONFIG_FULL_DYNAMIC_VLAN */
|
||||||
@ -164,7 +163,7 @@ static int ifconfig_helper(const char *if_name, int up)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static int ifconfig_up(const char *if_name)
|
int ifconfig_up(const char *if_name)
|
||||||
{
|
{
|
||||||
wpa_printf(MSG_DEBUG, "VLAN: Set interface %s up", if_name);
|
wpa_printf(MSG_DEBUG, "VLAN: Set interface %s up", if_name);
|
||||||
return ifconfig_helper(if_name, 1);
|
return ifconfig_helper(if_name, 1);
|
||||||
@ -239,13 +238,6 @@ static int ifconfig_down(const char *if_name)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
* These are only available in recent linux headers (without the leading
|
|
||||||
* underscore).
|
|
||||||
*/
|
|
||||||
#define _GET_VLAN_REALDEV_NAME_CMD 8
|
|
||||||
#define _GET_VLAN_VID_CMD 9
|
|
||||||
|
|
||||||
/* This value should be 256 ONLY. If it is something else, then hostapd
|
/* This value should be 256 ONLY. If it is something else, then hostapd
|
||||||
* might crash!, as this value has been hard-coded in 2.4.x kernel
|
* might crash!, as this value has been hard-coded in 2.4.x kernel
|
||||||
* bridging code.
|
* bridging code.
|
||||||
@ -480,150 +472,6 @@ static int br_getnumports(const char *br_name)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#ifndef CONFIG_VLAN_NETLINK
|
|
||||||
|
|
||||||
int vlan_rem(const char *if_name)
|
|
||||||
{
|
|
||||||
int fd;
|
|
||||||
struct vlan_ioctl_args if_request;
|
|
||||||
|
|
||||||
wpa_printf(MSG_DEBUG, "VLAN: vlan_rem(%s)", if_name);
|
|
||||||
if ((os_strlen(if_name) + 1) > sizeof(if_request.device1)) {
|
|
||||||
wpa_printf(MSG_ERROR, "VLAN: Interface name too long: '%s'",
|
|
||||||
if_name);
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ((fd = socket(AF_INET, SOCK_STREAM, 0)) < 0) {
|
|
||||||
wpa_printf(MSG_ERROR, "VLAN: %s: socket(AF_INET,SOCK_STREAM) "
|
|
||||||
"failed: %s", __func__, strerror(errno));
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
os_memset(&if_request, 0, sizeof(if_request));
|
|
||||||
|
|
||||||
os_strlcpy(if_request.device1, if_name, sizeof(if_request.device1));
|
|
||||||
if_request.cmd = DEL_VLAN_CMD;
|
|
||||||
|
|
||||||
if (ioctl(fd, SIOCSIFVLAN, &if_request) < 0) {
|
|
||||||
wpa_printf(MSG_ERROR, "VLAN: %s: DEL_VLAN_CMD failed for %s: "
|
|
||||||
"%s", __func__, if_name, strerror(errno));
|
|
||||||
close(fd);
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
close(fd);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
Add a vlan interface with VLAN ID 'vid' and tagged interface
|
|
||||||
'if_name'.
|
|
||||||
|
|
||||||
returns -1 on error
|
|
||||||
returns 1 if the interface already exists
|
|
||||||
returns 0 otherwise
|
|
||||||
*/
|
|
||||||
int vlan_add(const char *if_name, int vid, const char *vlan_if_name)
|
|
||||||
{
|
|
||||||
int fd;
|
|
||||||
struct vlan_ioctl_args if_request;
|
|
||||||
|
|
||||||
wpa_printf(MSG_DEBUG, "VLAN: vlan_add(if_name=%s, vid=%d)",
|
|
||||||
if_name, vid);
|
|
||||||
ifconfig_up(if_name);
|
|
||||||
|
|
||||||
if ((os_strlen(if_name) + 1) > sizeof(if_request.device1)) {
|
|
||||||
wpa_printf(MSG_ERROR, "VLAN: Interface name too long: '%s'",
|
|
||||||
if_name);
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ((fd = socket(AF_INET, SOCK_STREAM, 0)) < 0) {
|
|
||||||
wpa_printf(MSG_ERROR, "VLAN: %s: socket(AF_INET,SOCK_STREAM) "
|
|
||||||
"failed: %s", __func__, strerror(errno));
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
os_memset(&if_request, 0, sizeof(if_request));
|
|
||||||
|
|
||||||
/* Determine if a suitable vlan device already exists. */
|
|
||||||
|
|
||||||
os_snprintf(if_request.device1, sizeof(if_request.device1), "vlan%d",
|
|
||||||
vid);
|
|
||||||
|
|
||||||
if_request.cmd = _GET_VLAN_VID_CMD;
|
|
||||||
|
|
||||||
if (ioctl(fd, SIOCSIFVLAN, &if_request) == 0) {
|
|
||||||
|
|
||||||
if (if_request.u.VID == vid) {
|
|
||||||
if_request.cmd = _GET_VLAN_REALDEV_NAME_CMD;
|
|
||||||
|
|
||||||
if (ioctl(fd, SIOCSIFVLAN, &if_request) == 0 &&
|
|
||||||
os_strncmp(if_request.u.device2, if_name,
|
|
||||||
sizeof(if_request.u.device2)) == 0) {
|
|
||||||
close(fd);
|
|
||||||
wpa_printf(MSG_DEBUG, "VLAN: vlan_add: "
|
|
||||||
"if_name %s exists already",
|
|
||||||
if_request.device1);
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* A suitable vlan device does not already exist, add one. */
|
|
||||||
|
|
||||||
os_memset(&if_request, 0, sizeof(if_request));
|
|
||||||
os_strlcpy(if_request.device1, if_name, sizeof(if_request.device1));
|
|
||||||
if_request.u.VID = vid;
|
|
||||||
if_request.cmd = ADD_VLAN_CMD;
|
|
||||||
|
|
||||||
if (ioctl(fd, SIOCSIFVLAN, &if_request) < 0) {
|
|
||||||
wpa_printf(MSG_ERROR, "VLAN: %s: ADD_VLAN_CMD failed for %s: "
|
|
||||||
"%s",
|
|
||||||
__func__, if_request.device1, strerror(errno));
|
|
||||||
close(fd);
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
close(fd);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static int vlan_set_name_type(unsigned int name_type)
|
|
||||||
{
|
|
||||||
int fd;
|
|
||||||
struct vlan_ioctl_args if_request;
|
|
||||||
|
|
||||||
wpa_printf(MSG_DEBUG, "VLAN: vlan_set_name_type(name_type=%u)",
|
|
||||||
name_type);
|
|
||||||
if ((fd = socket(AF_INET, SOCK_STREAM, 0)) < 0) {
|
|
||||||
wpa_printf(MSG_ERROR, "VLAN: %s: socket(AF_INET,SOCK_STREAM) "
|
|
||||||
"failed: %s", __func__, strerror(errno));
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
os_memset(&if_request, 0, sizeof(if_request));
|
|
||||||
|
|
||||||
if_request.u.name_type = name_type;
|
|
||||||
if_request.cmd = SET_VLAN_NAME_TYPE_CMD;
|
|
||||||
if (ioctl(fd, SIOCSIFVLAN, &if_request) < 0) {
|
|
||||||
wpa_printf(MSG_ERROR, "VLAN: %s: SET_VLAN_NAME_TYPE_CMD "
|
|
||||||
"name_type=%u failed: %s",
|
|
||||||
__func__, name_type, strerror(errno));
|
|
||||||
close(fd);
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
close(fd);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif /* CONFIG_VLAN_NETLINK */
|
|
||||||
|
|
||||||
|
|
||||||
static void vlan_newlink_tagged(int vlan_naming, const char *tagged_interface,
|
static void vlan_newlink_tagged(int vlan_naming, const char *tagged_interface,
|
||||||
const char *br_name, int vid,
|
const char *br_name, int vid,
|
||||||
struct hostapd_data *hapd)
|
struct hostapd_data *hapd)
|
||||||
@ -973,12 +821,10 @@ full_dynamic_vlan_init(struct hostapd_data *hapd)
|
|||||||
if (priv == NULL)
|
if (priv == NULL)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
#ifndef CONFIG_VLAN_NETLINK
|
|
||||||
vlan_set_name_type(hapd->conf->ssid.vlan_naming ==
|
vlan_set_name_type(hapd->conf->ssid.vlan_naming ==
|
||||||
DYNAMIC_VLAN_NAMING_WITH_DEVICE ?
|
DYNAMIC_VLAN_NAMING_WITH_DEVICE ?
|
||||||
VLAN_NAME_TYPE_RAW_PLUS_VID_NO_PAD :
|
VLAN_NAME_TYPE_RAW_PLUS_VID_NO_PAD :
|
||||||
VLAN_NAME_TYPE_PLUS_VID_NO_PAD);
|
VLAN_NAME_TYPE_PLUS_VID_NO_PAD);
|
||||||
#endif /* CONFIG_VLAN_NETLINK */
|
|
||||||
|
|
||||||
priv->s = socket(PF_NETLINK, SOCK_RAW, NETLINK_ROUTE);
|
priv->s = socket(PF_NETLINK, SOCK_RAW, NETLINK_ROUTE);
|
||||||
if (priv->s < 0) {
|
if (priv->s < 0) {
|
||||||
|
163
src/ap/vlan_ioctl.c
Normal file
163
src/ap/vlan_ioctl.c
Normal file
@ -0,0 +1,163 @@
|
|||||||
|
/*
|
||||||
|
* hostapd / VLAN ioctl API
|
||||||
|
* Copyright 2003, Instant802 Networks, Inc.
|
||||||
|
* Copyright 2005-2006, Devicescape Software, Inc.
|
||||||
|
* Copyright (c) 2009, Jouni Malinen <j@w1.fi>
|
||||||
|
*
|
||||||
|
* This software may be distributed under the terms of the BSD license.
|
||||||
|
* See README for more details.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "utils/includes.h"
|
||||||
|
#include <sys/ioctl.h>
|
||||||
|
#include <linux/sockios.h>
|
||||||
|
#include <linux/if_vlan.h>
|
||||||
|
|
||||||
|
#include "utils/common.h"
|
||||||
|
#include "vlan_util.h"
|
||||||
|
|
||||||
|
/*
|
||||||
|
* These are only available in recent linux headers (without the leading
|
||||||
|
* underscore).
|
||||||
|
*/
|
||||||
|
#define _GET_VLAN_REALDEV_NAME_CMD 8
|
||||||
|
#define _GET_VLAN_VID_CMD 9
|
||||||
|
|
||||||
|
|
||||||
|
int vlan_rem(const char *if_name)
|
||||||
|
{
|
||||||
|
int fd;
|
||||||
|
struct vlan_ioctl_args if_request;
|
||||||
|
|
||||||
|
wpa_printf(MSG_DEBUG, "VLAN: vlan_rem(%s)", if_name);
|
||||||
|
if ((os_strlen(if_name) + 1) > sizeof(if_request.device1)) {
|
||||||
|
wpa_printf(MSG_ERROR, "VLAN: Interface name too long: '%s'",
|
||||||
|
if_name);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((fd = socket(AF_INET, SOCK_STREAM, 0)) < 0) {
|
||||||
|
wpa_printf(MSG_ERROR, "VLAN: %s: socket(AF_INET,SOCK_STREAM) "
|
||||||
|
"failed: %s", __func__, strerror(errno));
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
os_memset(&if_request, 0, sizeof(if_request));
|
||||||
|
|
||||||
|
os_strlcpy(if_request.device1, if_name, sizeof(if_request.device1));
|
||||||
|
if_request.cmd = DEL_VLAN_CMD;
|
||||||
|
|
||||||
|
if (ioctl(fd, SIOCSIFVLAN, &if_request) < 0) {
|
||||||
|
wpa_printf(MSG_ERROR, "VLAN: %s: DEL_VLAN_CMD failed for %s: "
|
||||||
|
"%s", __func__, if_name, strerror(errno));
|
||||||
|
close(fd);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
close(fd);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
Add a vlan interface with VLAN ID 'vid' and tagged interface
|
||||||
|
'if_name'.
|
||||||
|
|
||||||
|
returns -1 on error
|
||||||
|
returns 1 if the interface already exists
|
||||||
|
returns 0 otherwise
|
||||||
|
*/
|
||||||
|
int vlan_add(const char *if_name, int vid, const char *vlan_if_name)
|
||||||
|
{
|
||||||
|
int fd;
|
||||||
|
struct vlan_ioctl_args if_request;
|
||||||
|
|
||||||
|
wpa_printf(MSG_DEBUG, "VLAN: vlan_add(if_name=%s, vid=%d)",
|
||||||
|
if_name, vid);
|
||||||
|
ifconfig_up(if_name);
|
||||||
|
|
||||||
|
if ((os_strlen(if_name) + 1) > sizeof(if_request.device1)) {
|
||||||
|
wpa_printf(MSG_ERROR, "VLAN: Interface name too long: '%s'",
|
||||||
|
if_name);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((fd = socket(AF_INET, SOCK_STREAM, 0)) < 0) {
|
||||||
|
wpa_printf(MSG_ERROR, "VLAN: %s: socket(AF_INET,SOCK_STREAM) "
|
||||||
|
"failed: %s", __func__, strerror(errno));
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
os_memset(&if_request, 0, sizeof(if_request));
|
||||||
|
|
||||||
|
/* Determine if a suitable vlan device already exists. */
|
||||||
|
|
||||||
|
os_snprintf(if_request.device1, sizeof(if_request.device1), "vlan%d",
|
||||||
|
vid);
|
||||||
|
|
||||||
|
if_request.cmd = _GET_VLAN_VID_CMD;
|
||||||
|
|
||||||
|
if (ioctl(fd, SIOCSIFVLAN, &if_request) == 0 &&
|
||||||
|
if_request.u.VID == vid) {
|
||||||
|
if_request.cmd = _GET_VLAN_REALDEV_NAME_CMD;
|
||||||
|
|
||||||
|
if (ioctl(fd, SIOCSIFVLAN, &if_request) == 0 &&
|
||||||
|
os_strncmp(if_request.u.device2, if_name,
|
||||||
|
sizeof(if_request.u.device2)) == 0) {
|
||||||
|
close(fd);
|
||||||
|
wpa_printf(MSG_DEBUG,
|
||||||
|
"VLAN: vlan_add: if_name %s exists already",
|
||||||
|
if_request.device1);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* A suitable vlan device does not already exist, add one. */
|
||||||
|
|
||||||
|
os_memset(&if_request, 0, sizeof(if_request));
|
||||||
|
os_strlcpy(if_request.device1, if_name, sizeof(if_request.device1));
|
||||||
|
if_request.u.VID = vid;
|
||||||
|
if_request.cmd = ADD_VLAN_CMD;
|
||||||
|
|
||||||
|
if (ioctl(fd, SIOCSIFVLAN, &if_request) < 0) {
|
||||||
|
wpa_printf(MSG_ERROR,
|
||||||
|
"VLAN: %s: ADD_VLAN_CMD failed for %s: %s",
|
||||||
|
__func__, if_request.device1, strerror(errno));
|
||||||
|
close(fd);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
close(fd);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int vlan_set_name_type(unsigned int name_type)
|
||||||
|
{
|
||||||
|
int fd;
|
||||||
|
struct vlan_ioctl_args if_request;
|
||||||
|
|
||||||
|
wpa_printf(MSG_DEBUG, "VLAN: vlan_set_name_type(name_type=%u)",
|
||||||
|
name_type);
|
||||||
|
if ((fd = socket(AF_INET, SOCK_STREAM, 0)) < 0) {
|
||||||
|
wpa_printf(MSG_ERROR,
|
||||||
|
"VLAN: %s: socket(AF_INET,SOCK_STREAM) failed: %s",
|
||||||
|
__func__, strerror(errno));
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
os_memset(&if_request, 0, sizeof(if_request));
|
||||||
|
|
||||||
|
if_request.u.name_type = name_type;
|
||||||
|
if_request.cmd = SET_VLAN_NAME_TYPE_CMD;
|
||||||
|
if (ioctl(fd, SIOCSIFVLAN, &if_request) < 0) {
|
||||||
|
wpa_printf(MSG_ERROR,
|
||||||
|
"VLAN: %s: SET_VLAN_NAME_TYPE_CMD name_type=%u failed: %s",
|
||||||
|
__func__, name_type, strerror(errno));
|
||||||
|
close(fd);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
close(fd);
|
||||||
|
return 0;
|
||||||
|
}
|
@ -174,3 +174,9 @@ vlan_rem_error:
|
|||||||
nl_socket_free(handle);
|
nl_socket_free(handle);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int vlan_set_name_type(unsigned int name_type)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* hostapd / VLAN netlink api
|
* hostapd / VLAN netlink/ioctl api
|
||||||
* Copyright (c) 2012, Michael Braun <michael-dev@fami-braun.de>
|
* Copyright (c) 2012, Michael Braun <michael-dev@fami-braun.de>
|
||||||
*
|
*
|
||||||
* This software may be distributed under the terms of the BSD license.
|
* This software may be distributed under the terms of the BSD license.
|
||||||
@ -11,5 +11,8 @@
|
|||||||
|
|
||||||
int vlan_add(const char *if_name, int vid, const char *vlan_if_name);
|
int vlan_add(const char *if_name, int vid, const char *vlan_if_name);
|
||||||
int vlan_rem(const char *if_name);
|
int vlan_rem(const char *if_name);
|
||||||
|
int vlan_set_name_type(unsigned int name_type);
|
||||||
|
|
||||||
|
int ifconfig_up(const char *if_name);
|
||||||
|
|
||||||
#endif /* VLAN_UTIL_H */
|
#endif /* VLAN_UTIL_H */
|
||||||
|
Loading…
Reference in New Issue
Block a user