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
linux amd64
autoreconf

00:00:18

 
  Precheck
passed #1359454
linux amd64
clang-format

00:00:18

passed #1359455
linux amd64
coccinelle

00:03:41

failed #1359456
linux amd64
danger

00:00:14

passed #1359453
linux amd64
misc

00:00:17

passed #1359457
linux amd64
tarball-create

00:01:52

 
  Build
passed #1359470
linux amd64
clang:asan

00:01:54

passed #1359474
linux amd64
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
linux amd64
clang:tsan

00:01:18

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

00:00:56

passed #1359469
linux amd64
gcc:asan

00:01:42

passed #1359462
linux amd64
gcc:buster:amd64

00:00:53

passed #1359459
linux amd64
gcc:centos7:amd64

00:00:53

passed #1359460
linux amd64
gcc:centos8:amd64

00:00:56

passed #1359468
linux amd64
gcc:focal:amd64

00:00:57

passed #1359473
linux amd64
gcc:mutexatomics

00:00:54

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

00:00:55

passed #1359463
linux amd64
gcc:sid:amd64

00:01:50

passed #1359465
linux i386
gcc:sid:i386

00:00:59

passed #1359475
linux amd64
gcc:softhsm2.4

00:01:04

passed #1359476
linux amd64
gcc:softhsm2.6

00:00:56

passed #1359461
linux amd64
gcc:stretch:amd64

00:01:03

passed #1359471
linux amd64
gcc:tsan

00:01:08

passed #1359466
linux amd64
gcc:tumbleweed:amd64

00:00:47

passed #1359467
linux amd64
gcc:xenial:amd64

00:00:58

passed #1359480
amd64 windows
msvc:windows:amd64

00:01:13

 
  Unit
passed #1359492
linux amd64
unit:clang:asan

00:01:19

passed #1359496
linux amd64
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
linux amd64
unit:clang:tsan

00:04:14

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

00:01:12

passed #1359491
linux amd64
unit:gcc:asan

00:01:23

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

00:02:03

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

00:01:10

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

00:01:09

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

00:01:16

passed #1359495
linux amd64
unit:gcc:mutexatomics

00:01:06

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

00:01:07

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

00:01:06

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

00:01:07

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

00:01:12

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

00:01:11

passed #1359493
linux amd64
unit:gcc:tsan

00:03:37

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

00:01:06

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

00:01:17

 
  System
passed #1359513
linux amd64
system:clang:asan

00:17:45

passed #1359517
linux amd64
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
linux amd64 allowed to fail
system:clang:tsan

00:20:33

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

00:15:52

passed #1359512
linux amd64
system:gcc:asan

00:17:59

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

00:17:42

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

00:15:18

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

00:17:33

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

00:15:09

passed #1359516
linux amd64
system:gcc:mutexatomics

00:15:23

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

00:13:53

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

00:15:17

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

00:15:18

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

00:15:32

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

00:13:55

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

00:21:09

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

00:14:18

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

00:15:26

 
  Docs
passed #1359522
linux amd64
docs

00:00:34

 
  Postcheck
passed #1359526
linux amd64
cppcheck

00:00:51

passed #1359523
linux amd64
flake8

00:00:24

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

00:00:23

passed #1359525
linux amd64
scan-build

00:04:32

 
Name Stage Failure
failed
system:gcc:tsan System
FAIL shutdown (exit status: 1)

$ find bin -name 'tsan.*' -exec python3 util/parse_tsan.py {} \;
Uploading artifacts for failed job
Uploading artifacts...
untracked: found 1549 files

Uploading artifacts as "archive" to coordinator... ok
id=1359514 responseStatus=201 Created token=CK-K6m18
Cleaning up file based variables
ERROR: Job failed: exit code 1
failed
system:clang:tsan System
FAIL fetchlimit (exit status: 1)

$ find bin -name 'tsan.*' -exec python3 util/parse_tsan.py {} \;
Uploading artifacts for failed job
Uploading artifacts...
untracked: found 1483 files

Uploading artifacts as "archive" to coordinator... ok
id=1359515 responseStatus=201 Created token=PxyBrAat
Cleaning up file based variables
ERROR: Job failed: exit code 1
failed
system:gcc:buster:amd64 System
FAIL upforwd (exit status: 1)

$ test -n "${OUT_OF_TREE_WORKSPACE}" && mv "${OUT_OF_TREE_WORKSPACE}" "${CI_PROJECT_DIR}"
Uploading artifacts for failed job
Uploading artifacts...
untracked: found 2829 files

Uploading artifacts as "archive" to coordinator... ok
id=1359506 responseStatus=201 Created token=mgiuotGs
Cleaning up file based variables
ERROR: Job failed: exit code 1
failed
system:gcc:sid:i386 System
FAIL fetchlimit (exit status: 1)

$ test -n "${OUT_OF_TREE_WORKSPACE}" && mv "${OUT_OF_TREE_WORKSPACE}" "${CI_PROJECT_DIR}"
Uploading artifacts for failed job
Uploading artifacts...
untracked: found 1458 files

Uploading artifacts as "archive" to coordinator... ok
id=1359508 responseStatus=201 Created token=G_v6gsEn
Cleaning up file based variables
ERROR: Job failed: exit code 1
failed
system:gcc:alpine3.12:amd64 System
FAIL upforwd (exit status: 1)

$ test -n "${OUT_OF_TREE_WORKSPACE}" && mv "${OUT_OF_TREE_WORKSPACE}" "${CI_PROJECT_DIR}"
Uploading artifacts for failed job
Uploading artifacts...
untracked: found 1531 files

Uploading artifacts as "archive" to coordinator... ok
id=1359502 responseStatus=201 Created token=cERoZ_gB
Cleaning up file based variables
ERROR: Job failed: exit code 1
failed
system:gcc:centos7:amd64 System
FAIL upforwd (exit status: 1)

$ test -n "${OUT_OF_TREE_WORKSPACE}" && mv "${OUT_OF_TREE_WORKSPACE}" "${CI_PROJECT_DIR}"
Uploading artifacts for failed job
Uploading artifacts...
untracked: found 1494 files

Uploading artifacts as "archive" to coordinator... ok
id=1359503 responseStatus=201 Created token=fTz2Br5X
Cleaning up file based variables
ERROR: Job failed: exit code 1
failed
unit:gcc:softhsm2.6 Unit
make[1]: Leaving directory '/builds/isc-projects/bind9/fuzz'
make: *** [Makefile:624: unit-recursive] Error 1
make: Target 'unit' not remade because of errors.
Uploading artifacts for failed job
Uploading artifacts...
untracked: found 1661 files

Uploading artifacts as "archive" to coordinator... ok
id=1359498 responseStatus=201 Created token=yREH21DT
Cleaning up file based variables
ERROR: Job failed: exit code 1
failed
danger Precheck
 * [new branch]      main       -> origin/main



Failing the build, there are 2 fails.
Feedback: https://gitlab.isc.org/isc-projects/bind9/merge_requests/4251#note_168466

Cleaning up file based variables
ERROR: Job failed: exit code 1