coap_address.c: Broadcast address cannot be local IP address

This commit is contained in:
Jon Shallow authored and Jon Shallow committed 2023-10-19 10:39:10 +01:00
1 parent 48753b155b
commit cd1a7de0f2
1 file changed
+2 -1
+2 -1
View File
@@ -219,7 +219,8 @@ coap_is_bcast(const coap_address_t *a) {
if (ife->ifa_addr && ife->ifa_addr->sa_family == AF_INET &&
ife->ifa_flags & IFF_BROADCAST) {
b_ipv4[bcst_cnt].s_addr = ((struct sockaddr_in *)ife->ifa_broadaddr)->sin_addr.s_addr;
bcst_cnt++;
if (b_ipv4[bcst_cnt].s_addr != ipv4.s_addr)
bcst_cnt++;
}
ife = ife->ifa_next;
}