summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sbin/unwind/libunbound/util/netevent.c5
-rw-r--r--usr.sbin/unbound/util/netevent.c5
2 files changed, 6 insertions, 4 deletions
diff --git a/sbin/unwind/libunbound/util/netevent.c b/sbin/unwind/libunbound/util/netevent.c
index 990388ba70e..895c31d3411 100644
--- a/sbin/unwind/libunbound/util/netevent.c
+++ b/sbin/unwind/libunbound/util/netevent.c
@@ -379,8 +379,9 @@ comm_point_send_udp_msg(struct comm_point *c, sldns_buffer* packet,
if(!udp_send_errno_needs_log(addr, addrlen))
return 0;
verbose(VERB_OPS, "sendto failed: %s", sock_strerror(errno));
- log_addr(VERB_OPS, "remote address is",
- (struct sockaddr_storage*)addr, addrlen);
+ if(addr)
+ log_addr(VERB_OPS, "remote address is",
+ (struct sockaddr_storage*)addr, addrlen);
return 0;
} else if((size_t)sent != sldns_buffer_remaining(packet)) {
log_err("sent %d in place of %d bytes",
diff --git a/usr.sbin/unbound/util/netevent.c b/usr.sbin/unbound/util/netevent.c
index 8bbad15920a..2577af12bc8 100644
--- a/usr.sbin/unbound/util/netevent.c
+++ b/usr.sbin/unbound/util/netevent.c
@@ -379,8 +379,9 @@ comm_point_send_udp_msg(struct comm_point *c, sldns_buffer* packet,
if(!udp_send_errno_needs_log(addr, addrlen))
return 0;
verbose(VERB_OPS, "sendto failed: %s", sock_strerror(errno));
- log_addr(VERB_OPS, "remote address is",
- (struct sockaddr_storage*)addr, addrlen);
+ if(addr)
+ log_addr(VERB_OPS, "remote address is",
+ (struct sockaddr_storage*)addr, addrlen);
return 0;
} else if((size_t)sent != sldns_buffer_remaining(packet)) {
log_err("sent %d in place of %d bytes",