diff options
author | Ross Burton <ross.burton@arm.com> | 2023-01-13 17:14:31 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2023-01-26 23:39:06 +0000 |
commit | cae761d7314992ad862698973326595636851997 (patch) | |
tree | 85f25b4883a06b1b97b2e58b8c014944cb919e13 | |
parent | b947c51178283875f07adb6e1e590de6884f6c9a (diff) | |
download | poky-cae761d7314992ad862698973326595636851997.tar.gz |
cve-update-db-native: show IP on failure
We get random SSL failures when fetching the CVE database, and it's
notable that the NVD server is behind a DNS round-robin or geographically
diverse servers.
On a hunch that there is one misconfigured server, dump the IP that we
connected to.
(From OE-Core rev: 60e06c9666a2b254c50b2f51932d395f88dd550c)
Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit 91f46d431dc8f40e8c6475c800bb61cb08b82b0a)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r-- | meta/recipes-core/meta/cve-update-db-native.bb | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/meta/recipes-core/meta/cve-update-db-native.bb b/meta/recipes-core/meta/cve-update-db-native.bb index 079f062f79..e042e67b09 100644 --- a/meta/recipes-core/meta/cve-update-db-native.bb +++ b/meta/recipes-core/meta/cve-update-db-native.bb | |||
@@ -130,7 +130,10 @@ def update_db_file(db_tmp_file, d): | |||
130 | response = urllib.request.urlopen(meta_url, timeout=cve_socket_timeout) | 130 | response = urllib.request.urlopen(meta_url, timeout=cve_socket_timeout) |
131 | except urllib.error.URLError as e: | 131 | except urllib.error.URLError as e: |
132 | cve_f.write('Warning: CVE db update error, Unable to fetch CVE data.\n\n') | 132 | cve_f.write('Warning: CVE db update error, Unable to fetch CVE data.\n\n') |
133 | bb.warn("Failed to fetch CVE data (%s)" % e.reason) | 133 | bb.warn("Failed to fetch CVE data (%s)" % e) |
134 | import socket | ||
135 | result = socket.getaddrinfo("nvd.nist.gov", 443, proto=socket.IPPROTO_TCP) | ||
136 | bb.warn("Host IPs are %s" % (", ".join(t[4][0] for t in result))) | ||
134 | return False | 137 | return False |
135 | 138 | ||
136 | if response: | 139 | if response: |