File: 0011-Allow-kpropd-to-bind-even-if-only-loopback-is-config.patch

package info (click to toggle)
krb5 1.22.1-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 52,652 kB
  • sloc: ansic: 293,109; python: 10,357; cpp: 9,477; makefile: 7,035; sh: 6,189; perl: 1,650; asm: 1,212; yacc: 933; javascript: 789; awk: 344; csh: 147; xml: 135; lisp: 104
file content (29 lines) | stat: -rw-r--r-- 1,106 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
From: Sam Hartman <hartmans@debian.org>
Date: Fri, 14 Jun 2024 14:59:28 -0600
Subject: Allow kpropd to bind even if only loopback is configured

In src/kprop/kpropd.c get_wildcard_address, call getaddrinfo without
AI_ADDRCONFIG if both the v6 and v4 calls to getaddrinfo fail with
AI_ADDRCONFIG. This generally means that only the loopback interface
is configured. This change allows the testsuite to succeed ina
container isolated to prohibit network connectivity.
---
 src/kprop/kpropd.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/kprop/kpropd.c b/src/kprop/kpropd.c
index 4b36752..813978c 100644
--- a/src/kprop/kpropd.c
+++ b/src/kprop/kpropd.c
@@ -373,6 +373,11 @@ get_wildcard_addr(struct addrinfo **res)
     if (error == 0)
         return 0;
     hints.ai_family = AF_INET;
+    error =  getaddrinfo(NULL, port, &hints, res);
+    if (error == 0)
+        return 0;
+    /* We may only have loopback addresses configured. Especially for the test framework, this is a valid configuration.*/
+    hints.ai_flags = AI_PASSIVE;
     return getaddrinfo(NULL, port, &hints, res);
 }