summaryrefslogtreecommitdiffstats
path: root/src/socket.c
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2014-01-26 09:36:50 +0100
committerMatthias Schiffer <mschiffer@universe-factory.net>2014-01-26 09:36:50 +0100
commitda31c063de92d725bf706bb8ed7a79f9e03f8755 (patch)
tree18cf0a06872f7a746c9290296d3dad94489bf8d2 /src/socket.c
parent534ae7240bc5cad6edb9fd160cdb0ff0eb4778de (diff)
downloadfastd-da31c063de92d725bf706bb8ed7a79f9e03f8755.tar
fastd-da31c063de92d725bf706bb8ed7a79f9e03f8755.zip
Nicer log message on failed link-local binds
Diffstat (limited to 'src/socket.c')
-rw-r--r--src/socket.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/socket.c b/src/socket.c
index 25f50e7..a9e6f33 100644
--- a/src/socket.c
+++ b/src/socket.c
@@ -114,7 +114,8 @@ static int bind_socket(fastd_context_t *ctx, const fastd_bind_address_t *addr, b
bind_address.in6.sin6_scope_id = if_nametoindex(addr->bindtodev);
if (!bind_address.in6.sin6_scope_id) {
- pr_warn_errno(ctx, "if_nametoindex");
+ if (warn)
+ pr_warn_errno(ctx, "if_nametoindex");
goto error;
}
}
@@ -145,7 +146,7 @@ static int bind_socket(fastd_context_t *ctx, const fastd_bind_address_t *addr, b
if (warn) {
if (addr->bindtodev)
- pr_warn(ctx, "unable to bind to %B on `%s'", &addr->addr, addr->bindtodev);
+ pr_warn(ctx, fastd_peer_address_is_v6_ll(&addr->addr) ? "unable to bind to %L" : "unable to bind to %B on `%s'", &addr->addr, addr->bindtodev);
else
pr_warn(ctx, "unable to bind to %B", &addr->addr);
}