Use IP_RECVERR / IPV6_RECVERR to learn about ICMP destination unreachable

BIND 9 uses a connect()ed UDP socket when sending recursive queries.
The connect()ed socket provides feedback on a variety of ICMP
errors (e.g.  port unreachable) which BIND 9 can then use to decide what
to do with errors (report them to the client, try again with a different
nameserver etc).

However, Linux's implementation does not report what it considers
"transient" conditions, which is defined as Destination Host
Unreachable, Destination Network Unreachable, Source Route Failed and
Message Too Big.

BIND 9 now uses set setsockopt(fd, SOL_IP(V6), IP(V6)_RECVERR, &one,
sizeof(one)); and receive a EPOLL_ERR, and recvmsg return value so that
it notices that the send has failed immediately rather than waiting for
a timeout.
Status Job ID Name Coverage
  Autoconf
passed #1359452
amd64 linux
autoreconf

00:00:18

 
  Precheck
passed #1359454
amd64 linux
clang-format

00:00:18

passed #1359455
amd64 linux
coccinelle

00:03:41

failed #1359456
amd64 linux
danger

00:00:14

passed #1359453
amd64 linux
misc

00:00:17

passed #1359457
amd64 linux
tarball-create

00:01:52

 
  Build
passed #1359470
amd64 linux
clang:asan

00:01:54

passed #1359474
amd64 linux
clang:buster:amd64

00:01:10

passed #1359477
amd64 libvirt
clang:freebsd11:amd64

00:01:10

passed #1359478
amd64 libvirt
clang:freebsd12:amd64

00:01:12

passed #1359479
amd64 libvirt
clang:openbsd:amd64

00:02:43

passed #1359472
amd64 linux
clang:tsan

00:01:18

passed #1359458
amd64 linux
gcc:alpine3.12:amd64

00:00:56

passed #1359469
amd64 linux
gcc:asan

00:01:42

passed #1359462
amd64 linux
gcc:buster:amd64

00:00:53

passed #1359459
amd64 linux
gcc:centos7:amd64

00:00:53

passed #1359460
amd64 linux
gcc:centos8:amd64

00:00:56

passed #1359468
amd64 linux
gcc:focal:amd64

00:00:57

passed #1359473
amd64 linux
gcc:mutexatomics

00:00:54

passed #1359464
amd64 linux
gcc:out-of-tree

00:00:55

passed #1359463
amd64 linux
gcc:sid:amd64

00:01:50

passed #1359465
i386 linux
gcc:sid:i386

00:00:59

passed #1359475
amd64 linux
gcc:softhsm2.4

00:01:04

passed #1359476
amd64 linux
gcc:softhsm2.6

00:00:56

passed #1359461
amd64 linux
gcc:stretch:amd64

00:01:03

passed #1359471
amd64 linux
gcc:tsan

00:01:08

passed #1359466
amd64 linux
gcc:tumbleweed:amd64

00:00:47

passed #1359467
amd64 linux
gcc:xenial:amd64

00:00:58

passed #1359480
amd64 windows
msvc:windows:amd64

00:01:13

 
  Unit
passed #1359492
amd64 linux
unit:clang:asan

00:01:19

passed #1359496
amd64 linux
unit:clang:buster:amd64

00:01:12

passed #1359499
amd64 libvirt
unit:clang:freebsd11:amd64

00:01:28

passed #1359500
amd64 libvirt
unit:clang:freebsd12:amd64

00:01:29

passed #1359501
amd64 libvirt
unit:clang:openbsd:amd64

00:02:48

passed #1359494
amd64 linux
unit:clang:tsan

00:04:14

passed #1359481
amd64 linux
unit:gcc:alpine3.12:amd64

00:01:12

passed #1359491
amd64 linux
unit:gcc:asan

00:01:23

passed #1359485
amd64 linux
unit:gcc:buster:amd64

00:02:03

passed #1359482
amd64 linux
unit:gcc:centos7:amd64

00:01:10

passed #1359483
amd64 linux
unit:gcc:centos8:amd64

00:01:09

passed #1359490
amd64 linux
unit:gcc:focal:amd64

00:01:16

passed #1359495
amd64 linux
unit:gcc:mutexatomics

00:01:06

passed #1359486
amd64 linux
unit:gcc:sid:amd64

00:01:07

passed #1359487
i386 linux
unit:gcc:sid:i386

00:01:06

passed #1359497
amd64 linux
unit:gcc:softhsm2.4

00:01:07

failed #1359498
amd64 linux
unit:gcc:softhsm2.6

00:01:12

passed #1359484
amd64 linux
unit:gcc:stretch:amd64

00:01:11

passed #1359493
amd64 linux
unit:gcc:tsan

00:03:37

passed #1359488
amd64 linux
unit:gcc:tumbleweed:amd64

00:01:06

passed #1359489
amd64 linux
unit:gcc:xenial:amd64

00:01:17

 
  System
passed #1359513
amd64 linux
system:clang:asan

00:17:45

passed #1359517
amd64 linux
system:clang:buster:amd64

00:13:41

passed #1359520
amd64 libvirt
system:clang:freebsd11:amd64

00:12:07

passed #1359521
amd64 libvirt
system:clang:freebsd12:amd64

00:14:05

failed #1359515
amd64 linux allowed to fail
system:clang:tsan

00:20:33

failed #1359502
amd64 linux
system:gcc:alpine3.12:amd64

00:15:52

passed #1359512
amd64 linux
system:gcc:asan

00:17:59

failed #1359506
amd64 linux
system:gcc:buster:amd64

00:17:42

failed #1359503
amd64 linux
system:gcc:centos7:amd64

00:15:18

passed #1359504
amd64 linux
system:gcc:centos8:amd64

00:17:33

passed #1359511
amd64 linux
system:gcc:focal:amd64

00:15:09

passed #1359516
amd64 linux
system:gcc:mutexatomics

00:15:23

passed #1359507
amd64 linux
system:gcc:sid:amd64

00:13:53

failed #1359508
i386 linux
system:gcc:sid:i386

00:15:17

passed #1359518
amd64 linux
system:gcc:softhsm2.4

00:15:18

passed #1359519
amd64 linux
system:gcc:softhsm2.6

00:15:32

passed #1359505
amd64 linux
system:gcc:stretch:amd64

00:13:55

failed #1359514
amd64 linux allowed to fail
system:gcc:tsan

00:21:09

passed #1359509
amd64 linux
system:gcc:tumbleweed:amd64

00:14:18

passed #1359510
amd64 linux
system:gcc:xenial:amd64

00:15:26

 
  Docs
passed #1359522
amd64 linux
docs

00:00:34

 
  Postcheck
passed #1359526
amd64 linux
cppcheck

00:00:51

passed #1359523
amd64 linux
flake8

00:00:24

skipped #1359527
amd64 linux
gcov
passed #1359524
amd64 linux
pylint

00:00:23

passed #1359525
amd64 linux
scan-build

00:04:32

 
Name Stage Failure
failed
system:gcc:tsan System
No job log
failed
system:clang:tsan System
No job log
failed
system:gcc:buster:amd64 System
No job log
failed
system:gcc:sid:i386 System
No job log
failed
system:gcc:alpine3.12:amd64 System
No job log
failed
system:gcc:centos7:amd64 System
No job log
failed
unit:gcc:softhsm2.6 Unit
No job log
failed
danger Precheck
No job log