if (HOSTAPD_ACTION_DELNODE)
if (frame->f_action == HOSTAPD_ACTION_DELNODE)
hostapd_handle_action(struct hostapd_config *cfg, struct hostapd_frame *frame,    u_int8_t *wfrom, u_int8_t *wto, u_int8_t *wbssid, u_int8_t *buf,    const u_int len){	struct hostapd_action_data *action = &frame->f_action_data;	struct hostapd_node node;	u_int8_t *lladdr = NULL;	int ret = 0, offset;	switch (frame->f_action) {	case HOSTAPD_ACTION_RADIOTAP:		/* Send IAPP frame with radiotap/pcap payload */		if ((ret = hostapd_iapp_radiotap(cfg, buf, len)) != 0)			return (ret);		if ((frame->f_action_flags & HOSTAPD_ACTION_VERBOSE) == 0)			return (0);		hostapd_log(HOSTAPD_LOG,		    "%s: sent IAPP frame HOSTAPD_%s (%u bytes)\n",		    cfg->c_iapp_iface, cfg->c_apme_dlt ==		    DLT_IEEE802_11_RADIO ? "RADIOTAP" : "PCAP", len);		break;	case HOSTAPD_ACTION_LOG:		/* Log frame to syslog/stderr */		if (frame->f_rate && frame->f_rate_intval) {			hostapd_printf("%s: (rate: %ld/%ld sec) ",			    cfg->c_apme_iface, frame->f_rate_cnt,			    frame->f_rate_delay + 1);		} else			hostapd_printf("%s: ", cfg->c_apme_iface);		hostapd_print_ieee80211(cfg->c_apme_dlt, frame->f_action_flags &		    HOSTAPD_ACTION_VERBOSE, buf, len);		/* Flush output buffer */		hostapd_printf(NULL);		break;	case HOSTAPD_ACTION_DELNODE:	case HOSTAPD_ACTION_ADDNODE:		bzero(&node, sizeof(node));		if (action->a_flags & HOSTAPD_ACTION_F_REF_FROM)			lladdr = wfrom;		else if (action->a_flags & HOSTAPD_ACTION_F_REF_TO)			lladdr = wto;		else if (action->a_flags & HOSTAPD_ACTION_F_REF_BSSID)			lladdr = wbssid;		else			lladdr = action->a_lladdr;		bcopy(lladdr, &node.ni_macaddr, IEEE80211_ADDR_LEN);		if (HOSTAPD_ACTION_DELNODE)			ret = hostapd_apme_delnode(cfg, &node);		else			ret = hostapd_apme_addnode(cfg, &node);		if (ret != 0)  {			hostapd_log(HOSTAPD_LOG_DEBUG,			    "%s: node add/delete %s failed: %s\n",			    cfg->c_apme_iface, etheraddr_string(lladdr),			    strerror(ret));		}		break;	case HOSTAPD_ACTION_NONE:		/* Nothing */		break;	case HOSTAPD_ACTION_RESEND:		/* Resend received raw IEEE 802.11 frame */		if ((offset = hostapd_apme_offset(cfg, buf, len)) < 0)			return (EINVAL);		if (write(cfg->c_apme_raw, buf + offset, len - offset) == -1)			ret = errno;		break;	case HOSTAPD_ACTION_FRAME:		if (action->a_flags & HOSTAPD_ACTION_F_REF_M) {			hostapd_handle_ref(action->a_flags &			    HOSTAPD_ACTION_F_REF_FROM_M,			    HOSTAPD_ACTION_F_REF_FROM_S, wfrom, wto, wbssid,			    action->a_frame.i_from);			hostapd_handle_ref(action->a_flags &			    HOSTAPD_ACTION_F_REF_TO_M,			    HOSTAPD_ACTION_F_REF_TO_S, wfrom, wto, wbssid,			    action->a_frame.i_to);			hostapd_handle_ref(action->a_flags &			    HOSTAPD_ACTION_F_REF_BSSID_M,			    HOSTAPD_ACTION_F_REF_BSSID_S, wfrom, wto, wbssid,			    action->a_frame.i_bssid);		}		/* Send a raw IEEE 802.11 frame */		return (hostapd_apme_output(cfg, &action->a_frame));	default:		return (0);	}	return (ret);}