* [PATCH v4 1/7] profiles/network: Fix sending error in bnep server add
@ 2015-03-12 16:15 Grzegorz Kolodziejczyk
2015-03-12 16:41 ` Szymon Janc
0 siblings, 1 reply; 4+ messages in thread
From: Grzegorz Kolodziejczyk @ 2015-03-12 16:15 UTC (permalink / raw)
To: linux-bluetooth
If bnep server add will not proceed successfully, approperiate error
should be returned. Now it returns error if control message send will
fail.
---
profiles/network/bnep.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
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
@@ -650,6 +650,7 @@ int bnep_server_add(int sk, char *bridge, char *iface, const bdaddr_t *addr,
/* 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;
@@ -673,10 +674,11 @@ int bnep_server_add(int sk, char *bridge, char *iface, const bdaddr_t *addr,
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;
}
--
2.1.0
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: [PATCH v4 1/7] profiles/network: Fix sending error in bnep server add
2015-03-12 16:15 [PATCH v4 1/7] profiles/network: Fix sending error in bnep server add Grzegorz Kolodziejczyk
@ 2015-03-12 16:41 ` Szymon Janc
0 siblings, 0 replies; 4+ messages in thread
From: Szymon Janc @ 2015-03-12 16:41 UTC (permalink / raw)
To: Grzegorz Kolodziejczyk; +Cc: linux-bluetooth
Hi Grzegorz,
On Thursday 12 of March 2015 17:15:26 Grzegorz Kolodziejczyk wrote:
> If bnep server add will not proceed successfully, approperiate error
> should be returned. Now it returns error if control message send will
> fail.
> ---
> profiles/network/bnep.c | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
> 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
> @@ -650,6 +650,7 @@ int bnep_server_add(int sk, char *bridge, char *iface,
> const bdaddr_t *addr, /* 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;
> @@ -673,10 +674,11 @@ int bnep_server_add(int sk, char *bridge, char *iface,
> const bdaddr_t *addr, 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;
> }
Patch applied, thanks.
--
BR
Szymon Janc
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH v4 0/7] Create bneptest tool
@ 2015-03-12 16:06 Grzegorz Kolodziejczyk
2015-03-12 16:06 ` [PATCH v4 1/7] profiles/network: Fix sending error in bnep server add Grzegorz Kolodziejczyk
0 siblings, 1 reply; 4+ messages in thread
From: Grzegorz Kolodziejczyk @ 2015-03-12 16:06 UTC (permalink / raw)
To: linux-bluetooth
v4:
- Fix error returning in bnep server add
- Reorganize bnep service comparing (by uuid, by string),
- Fixed pointed by Szymon commit message typo,
- Add support for sending general bnep frames by bneptest,
- bneptest now require bridge and iface name (it was optional-def. names were
set)
- Update PTS results and test instructions.
Grzegorz Kolodziejczyk (7):
profiles/network: Fix sending error in bnep server add
profiles/network: Remove unneded bnep_uuid function from bnep code
profiles/network: Remove not needed get name by bnep id function
profiles/network: Move disconn cb setting to bnep connect method
tools/bneptest: Add initial support for bneptest tool
tools/bneptest: Add generic connect/listen functionality
android/pts: Add BNEP PTS 6.0 results for android 5.0
.gitignore | 1 +
Makefile.tools | 12 +-
android/Android.mk | 35 ++
android/Makefile.am | 5 +-
android/pan.c | 5 +-
android/pics-bnep.txt | 26 ++
android/pixit-bnep.txt | 30 ++
android/pts-bnep.txt | 48 +++
profiles/network/bnep.c | 59 +---
profiles/network/bnep.h | 9 +-
profiles/network/connection.c | 23 +-
profiles/network/server.c | 35 +-
tools/bneptest.c | 762 ++++++++++++++++++++++++++++++++++++++++++
13 files changed, 973 insertions(+), 77 deletions(-)
create mode 100644 android/pics-bnep.txt
create mode 100644 android/pixit-bnep.txt
create mode 100644 android/pts-bnep.txt
create mode 100644 tools/bneptest.c
--
2.1.0
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH v4 1/7] profiles/network: Fix sending error in bnep server add
2015-03-12 16:06 [PATCH v4 0/7] Create bneptest tool Grzegorz Kolodziejczyk
@ 2015-03-12 16:06 ` Grzegorz Kolodziejczyk
2015-03-12 16:12 ` Szymon Janc
0 siblings, 1 reply; 4+ messages in thread
From: Grzegorz Kolodziejczyk @ 2015-03-12 16:06 UTC (permalink / raw)
To: linux-bluetooth
If bnep server add will not proceed successfully, approperiate error
should be returned. Now it returns error if control message send will
fail.
---
profiles/network/bnep.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/profiles/network/bnep.c b/profiles/network/bnep.c
index adddc33..48926b4 100644
--- a/profiles/network/bnep.c
+++ b/profiles/network/bnep.c
@@ -650,6 +650,7 @@ int bnep_server_add(int sk, char *bridge, char *iface, const bdaddr_t *addr,
/* 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;
@@ -673,10 +674,11 @@ int bnep_server_add(int sk, char *bridge, char *iface, const bdaddr_t *addr,
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) {
error("bnep: send ctrl rsp error: %s (%d)", strerror(errno),
errno);
+ err = -errno;
+ }
return err;
}
--
2.1.0
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: [PATCH v4 1/7] profiles/network: Fix sending error in bnep server add
2015-03-12 16:06 ` [PATCH v4 1/7] profiles/network: Fix sending error in bnep server add Grzegorz Kolodziejczyk
@ 2015-03-12 16:12 ` Szymon Janc
0 siblings, 0 replies; 4+ messages in thread
From: Szymon Janc @ 2015-03-12 16:12 UTC (permalink / raw)
To: Grzegorz Kolodziejczyk; +Cc: linux-bluetooth
Hi Grzegorz,
On Thursday 12 of March 2015 17:06:36 Grzegorz Kolodziejczyk wrote:
> If bnep server add will not proceed successfully, approperiate error
> should be returned. Now it returns error if control message send will
> fail.
> ---
> profiles/network/bnep.c | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/profiles/network/bnep.c b/profiles/network/bnep.c
> index adddc33..48926b4 100644
> --- a/profiles/network/bnep.c
> +++ b/profiles/network/bnep.c
> @@ -650,6 +650,7 @@ int bnep_server_add(int sk, char *bridge, char *iface,
> const bdaddr_t *addr, /* 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;
> @@ -673,10 +674,11 @@ int bnep_server_add(int sk, char *bridge, char *iface,
> const bdaddr_t *addr, 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) {
> error("bnep: send ctrl rsp error: %s (%d)", strerror(errno),
> errno);
> + err = -errno;
errno should be saved before calling error().
> + }
>
> return err;
> }
--
BR
Szymon Janc
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2015-03-12 16:41 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-03-12 16:15 [PATCH v4 1/7] profiles/network: Fix sending error in bnep server add Grzegorz Kolodziejczyk
2015-03-12 16:41 ` Szymon Janc
-- strict thread matches above, loose matches on Subject: below --
2015-03-12 16:06 [PATCH v4 0/7] Create bneptest tool Grzegorz Kolodziejczyk
2015-03-12 16:06 ` [PATCH v4 1/7] profiles/network: Fix sending error in bnep server add Grzegorz Kolodziejczyk
2015-03-12 16:12 ` Szymon Janc
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox