diff --git a/src/ap.c b/src/ap.c index 5a86527f..6ab0c0fd 100644 --- a/src/ap.c +++ b/src/ap.c @@ -641,7 +641,7 @@ static void ap_set_beacon_cb(struct l_genl_msg *msg, void *user_data) l_error("SET_BEACON failed: %s (%i)", strerror(-error), -error); } -static void ap_update_beacon(struct ap_state *ap) +void ap_update_beacon(struct ap_state *ap) { struct l_genl_msg *cmd; uint8_t head[256], tail[256]; @@ -651,6 +651,9 @@ static void ap_update_beacon(struct ap_state *ap) 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }; + if (L_WARN_ON(!ap->started)) + return; + head_len = ap_build_beacon_pr_head(ap, MPDU_MANAGEMENT_SUBTYPE_BEACON, bcast_addr, head, sizeof(head)); tail_len = ap_build_beacon_pr_tail(ap, false, tail); diff --git a/src/ap.h b/src/ap.h index dc57a0bb..6199bcbe 100644 --- a/src/ap.h +++ b/src/ap.h @@ -87,3 +87,4 @@ bool ap_station_disconnect(struct ap_state *ap, const uint8_t *mac, enum mmpdu_reason_code reason); bool ap_push_button(struct ap_state *ap); +void ap_update_beacon(struct ap_state *ap);