diff --git a/profiles/network/bnep.c b/profiles/network/bnep.c
index adddc33..779c5fb 100644
--- a/profiles/network/bnep.c
+++ b/profiles/network/bnep.c
/* Processing BNEP_SETUP_CONNECTION_REQUEST_MSG */
rsp = bnep_setup_decode(sk, req, &dst);
if (rsp != BNEP_SUCCESS) {
+ err = -rsp;
error("bnep: error while decoding setup connection request: %d",
rsp);
goto reply;
rsp = BNEP_CONN_NOT_ALLOWED;
reply:
- err = bnep_send_ctrl_rsp(sk, BNEP_SETUP_CONN_RSP, rsp);
- if (err < 0)
+ if (bnep_send_ctrl_rsp(sk, BNEP_SETUP_CONN_RSP, rsp) < 0) {
+ err = -errno;
error("bnep: send ctrl rsp error: %s (%d)", strerror(errno),
errno);
+ }
return err;
}