Commit e0fd876
committed
app: coapc: Fix socket collision with nRF Cloud and provisioning
sm_coap_client is zero-initialized, so fd=0. Since Zephyr's ZVFS
allocates FDs from index 0, the first socket opened by nRF Cloud or
provisioning also gets FD 0. coap_client's get_client() then finds
sm_coap_client first in the registered clients array and misroutes
responses to it.
Initialize sm_coap_client.fd=-1 at init and reset it to -1 in
coap_close_request(), matching the pattern used by the nRF Cloud and
provisioning CoAP transports.
Signed-off-by: Juha Ylinen <juha.ylinen@nordicsemi.no>1 parent dde7101 commit e0fd876
1 file changed
Lines changed: 3 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
134 | 134 | | |
135 | 135 | | |
136 | 136 | | |
| 137 | + | |
| 138 | + | |
137 | 139 | | |
138 | 140 | | |
139 | 141 | | |
| |||
946 | 948 | | |
947 | 949 | | |
948 | 950 | | |
| 951 | + | |
949 | 952 | | |
950 | 953 | | |
951 | 954 | | |
| |||
0 commit comments