diff --git a/src/cntlr.h b/src/cntlr.h index 5e21cab38756d9cdfa1ea27b653611046a7224f5..470579a671e315e5e01271d04545461ca1160cfd 100644 --- a/src/cntlr.h +++ b/src/cntlr.h @@ -286,9 +286,10 @@ enum cntlr_state { CNTLR_START /* normal */ }; +#define STEER_MAX_CHANNEL 64 struct steering { int channels_num; - uint8_t channels[64]; + uint8_t channels[STEER_MAX_CHANNEL]; }; struct controller { diff --git a/src/cntlr_map.c b/src/cntlr_map.c index 4822aeb90ab9746e852e2575149e0e6609b79cc3..cac00a56bf95d495add2b2da5498acf878f1dadd 100644 --- a/src/cntlr_map.c +++ b/src/cntlr_map.c @@ -180,6 +180,13 @@ int handle_topology_notification(void *cntlr, struct cmdu_buff *cmdu, return 0; } +static void cntlr_reset_steer_params(struct controller *c) +{ + c->steer_params.channels_num = 0; + memset(c->steer_params.channels, 0, + STEER_MAX_CHANNEL * sizeof(c->steer_params.channels[0])); +} + static void cntlr_update_steer_params(struct controller *c, struct wifi_radio_opclass *op) { int i, j, k; @@ -1591,6 +1598,7 @@ int handle_oper_channel_report(void *cntlr, struct cmdu_buff *cmdu, struct node cntlr_radio_cur_opclass_dump(r->radio_el); /* Channel changed, update ctrl's steer params accordingly */ + cntlr_reset_steer_params(c); cntlr_update_steer_params(c, &r->radio_el->cur_opclass); }