aboutgitcodebugslistschat
diff options
context:
space:
mode:
-rw-r--r--fwd.c21
1 files changed, 13 insertions, 8 deletions
diff --git a/fwd.c b/fwd.c
index 4ba0af3..5679a3d 100644
--- a/fwd.c
+++ b/fwd.c
@@ -392,17 +392,22 @@ static int fwd_sync_one(const struct ctx *c, uint8_t pif, unsigned idx,
fd = pif_listen(c, rule->proto, pif, addr, ifname, port, idx);
if (fd < 0) {
char astr[INANY_ADDRSTRLEN];
+ int pri = LOG_WARNING;
- warn("Listen failed for %s %s port %s%s%s/%u: %s",
- pif_name(pif), ipproto_name(rule->proto),
- inany_ntop(addr, astr, sizeof(astr)),
- ifname ? "%" : "", ifname ? ifname : "",
- port, strerror_(-fd));
+ if (rule->flags & FWD_WEAK)
+ pri = LOG_DEBUG;
- if (!(rule->flags & FWD_WEAK))
- return -1;
+ logmsg(true, false, pri,
+ "Listen failed for %s %s port %s%s%s/%u: %s",
+ pif_name(pif), ipproto_name(rule->proto),
+ inany_ntop(addr, astr, sizeof(astr)),
+ ifname ? "%" : "", ifname ? ifname : "",
+ port, strerror_(-fd));
- continue;
+ if (rule->flags & FWD_WEAK)
+ continue;
+
+ return -1;
}
socks[port - rule->first] = fd;