mirror of
https://github.com/obgm/libcoap.git
synced 2026-11-04 00:45:40 +03:00
drop received packet if it is not received on the correct interface
This commit is contained in:
1 parent
235bf72e90
commit
0dcbf38a20
1 file changed
+6
-1
@@ -849,7 +849,12 @@ coap_read( coap_context_t *ctx ) {
|
||||
} else {
|
||||
#ifdef WITH_POSIX
|
||||
/* FIXME: make sure that dst == ctx->endpoint->addr */
|
||||
result = coap_handle_message(ctx, ctx->endpoint, packet);
|
||||
if (coap_address_isany(&ctx->endpoint->addr) ||
|
||||
coap_address_equals(&packet->dst, &ctx->endpoint->addr)) {
|
||||
result = coap_handle_message(ctx, ctx->endpoint, packet);
|
||||
} else {
|
||||
coap_log(LOG_DEBUG, "packet received on wrong interface, dropped\n");
|
||||
}
|
||||
#endif /* WITH_POSIX */
|
||||
#ifdef WITH_LWIP
|
||||
result = coap_handle_message(ctx, &src,
|
||||
|
||||
Reference in new issue
Block a user