Skip to content

Commit aa7d611

Browse files
committed
Only print EDESTADDRREQ send error once
1 parent 732be2e commit aa7d611

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

message.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1156,13 +1156,20 @@ flushbuf(struct buffered *buf, struct interface *ifp)
11561156
(struct sockaddr*)&buf->sin6,
11571157
sizeof(buf->sin6));
11581158
if(rc < 0) {
1159+
static int edestaddrreq_seen;
1160+
if (errno == EDESTADDRREQ) {
1161+
if (edestaddrreq_seen)
1162+
goto skip_send_error;
1163+
edestaddrreq_seen = 1;
1164+
}
11591165

11601166
char addr[INET6_ADDRSTRLEN+1];
11611167
uint32_t scope = buf->sin6.sin6_scope_id;
11621168
inet_ntop(AF_INET6, &buf->sin6.sin6_addr, addr, sizeof(addr));
11631169
fprintf(stderr, "send(%s%%%" PRIu32 "): %s\n",
11641170
addr, scope, strerror(errno));
11651171
}
1172+
skip_send_error:
11661173
}
11671174
VALGRIND_MAKE_MEM_UNDEFINED(buf->buf, buf->size);
11681175
buf->len = 0;

0 commit comments

Comments
 (0)