diff options
author | Matthias Schiffer <mschiffer@universe-factory.net> | 2014-09-04 23:02:22 +0200 |
---|---|---|
committer | Matthias Schiffer <mschiffer@universe-factory.net> | 2014-09-04 23:02:22 +0200 |
commit | 4bb2d6fb99723dfad2dbf405007eeba275652afc (patch) | |
tree | 3bc000796ca2578a8ae7a26e0e56ccb3268ca5fe /src/handshake.c | |
parent | c34b202fa90294a607e1ea926264edf30fd89ea6 (diff) | |
download | fastd-4bb2d6fb99723dfad2dbf405007eeba275652afc.tar fastd-4bb2d6fb99723dfad2dbf405007eeba275652afc.zip |
Nicer handshake error messages instead of "unacceptable value"
Diffstat (limited to 'src/handshake.c')
-rw-r--r-- | src/handshake.c | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/src/handshake.c b/src/handshake.c index 43f7b7a..9fe62cf 100644 --- a/src/handshake.c +++ b/src/handshake.c @@ -184,7 +184,24 @@ static void print_error(const char *prefix, const fastd_peer_address_t *remote_a break; case REPLY_UNACCEPTABLE_VALUE: - pr_warn("Handshake with %I failed: %s error: unacceptable value for field `%s'", remote_addr, prefix, error_field_str); + switch (error_detail) { + case RECORD_PROTOCOL_NAME: + pr_warn("Handshake with %I failed: %s error: peer doesn't use the handshake protocol `%s'", remote_addr, prefix, conf.protocol->name); + break; + + case RECORD_MODE: + pr_warn("Handshake with %I failed: %s error: TUN/TAP mode mismatch", remote_addr, prefix); + break; + + case RECORD_METHOD_NAME: + case RECORD_METHOD_LIST: + pr_warn("Handshake with %I failed: %s error: no common methods are configured", remote_addr, prefix); + break; + + default: + pr_warn("Handshake with %I failed: %s error: unacceptable value for field `%s'", remote_addr, prefix, error_field_str); + } + break; default: |