diff --git a/hostapd/Makefile b/hostapd/Makefile index 74633166d..efde3ed45 100644 --- a/hostapd/Makefile +++ b/hostapd/Makefile @@ -40,7 +40,7 @@ endif OBJS = hostapd.o ieee802_1x.o eapol_sm.o \ config.o ieee802_11_auth.o \ - sta_info.o wpa.o ctrl_iface.o \ + sta_info.o wpa.o \ drivers.o preauth.o pmksa_cache.o \ hw_features.o \ drv_callbacks.o \ @@ -77,6 +77,12 @@ else OBJS += vlan_init.o endif +ifdef CONFIG_NO_CTRL_IFACE +CFLAGS += -DCONFIG_NO_CTRL_IFACE +else +OBJS += ctrl_iface.o +endif + OBJS += ../src/crypto/md5.o OBJS += ../src/crypto/rc4.o OBJS += ../src/crypto/md4.o diff --git a/hostapd/config.c b/hostapd/config.c index 3d520f530..5a5751a71 100644 --- a/hostapd/config.c +++ b/hostapd/config.c @@ -1902,6 +1902,7 @@ struct hostapd_config * hostapd_config_read(const char *fname) } else if (os_strcmp(buf, "pmk_r1_push") == 0) { bss->pmk_r1_push = atoi(pos); #endif /* CONFIG_IEEE80211R */ +#ifndef CONFIG_NO_CTRL_IFACE } else if (os_strcmp(buf, "ctrl_interface") == 0) { os_free(bss->ctrl_interface); bss->ctrl_interface = os_strdup(pos); @@ -1933,6 +1934,7 @@ struct hostapd_config * hostapd_config_read(const char *fname) wpa_printf(MSG_DEBUG, "ctrl_interface_group=%d", bss->ctrl_interface_gid); #endif /* CONFIG_NATIVE_WINDOWS */ +#endif /* CONFIG_NO_CTRL_IFACE */ #ifdef RADIUS_SERVER } else if (os_strcmp(buf, "radius_server_clients") == 0) { os_free(bss->radius_server_clients); diff --git a/hostapd/ctrl_iface.h b/hostapd/ctrl_iface.h index 2ac2f3b29..4d9d663b8 100644 --- a/hostapd/ctrl_iface.h +++ b/hostapd/ctrl_iface.h @@ -15,9 +15,25 @@ #ifndef CTRL_IFACE_H #define CTRL_IFACE_H +#ifndef CONFIG_NO_CTRL_IFACE int hostapd_ctrl_iface_init(struct hostapd_data *hapd); void hostapd_ctrl_iface_deinit(struct hostapd_data *hapd); void hostapd_ctrl_iface_send(struct hostapd_data *hapd, int level, char *buf, size_t len); +#else /* CONFIG_NO_CTRL_IFACE */ +static inline int hostapd_ctrl_iface_init(struct hostapd_data *hapd) +{ + return 0; +} + +static inline void hostapd_ctrl_iface_deinit(struct hostapd_data *hapd) +{ +} + +static inline void hostapd_ctrl_iface_send(struct hostapd_data *hapd, + int level, char *buf, size_t len) +{ +} +#endif /* CONFIG_NO_CTRL_IFACE */ #endif /* CTRL_IFACE_H */