2012-06-19 09:11:46

by Zhang, Jingke

[permalink] [raw]
Subject: BT DUN Server fails to work (seems blocked in RFCOMM)

Hi all,
Does any guys try DUN server with bluez?

My telephone stack is ofono and its DUN server code should be ready in its commit. However, the problem is my DUN activation request almost did not come to ofono side (only to bluez RFCOMM). On the DUN Client, I can use same validation step to active a mobile phone (Sony-Ericson C905) to connect to 2G/3G network.

I filed a bug https://bugs.meego.com/show_bug.cgi?id=25303 to track all logs.

Could you help to see what's the problem?

Thanks
Jingke


2012-06-20 06:49:49

by Zheng, Wu

[permalink] [raw]
Subject: RE: BT DUN Server fails to work (seems blocked in RFCOMM)

Hi,

I check the issue of DUN response "security block".

If we set ssp mode to 0, the issue does not exist (hci_conn_check_link_mode return 1 in hci_conn.c).

However, why DUN connect cannot pass hci_conn_check_link_mode and FTP connect can pass hci_conn_check_link_mode?

Best regards
Zheng wu

> -----Original Message-----
> From: [email protected]
> [mailto:[email protected]] On Behalf Of Zhang, Jingke
> Sent: Wednesday, June 20, 2012 1:24 PM
> To: Frederic Danis
> Cc: [email protected]
> Subject: RE: BT DUN Server fails to work (seems blocked in RFCOMM)
>
> Hi Danis,
> I rebuild my bluez again without "--enable-pnat" in bootstrap-configure. Now,
> my sdp result shows ONLY ONE "Dial-up Networking" service. It is from ofonod.
>
> Retest this case. It reports "Security block" after DUN server gets "Dial-up
> Networking" record. The hcidump will be attached in bug ---
> https://bugs.meego.com/show_bug.cgi?id=25303 .
> At this time, I tried a FTP case (to prove pairing is OK), FTP passed.
>
> So, I suspect DUN response "security block" may be due to DUN service itself,
> which is provided by ofonod. Please help to check it. Thanks!
>
> -----Original Message-----
> From: [email protected]
> [mailto:[email protected]] On Behalf Of Frederic Danis
> Sent: Tuesday, June 19, 2012 6:53 PM
> To: Zhang, Jingke
> Cc: [email protected]
> Subject: Re: BT DUN Server fails to work (seems blocked in RFCOMM)
>
> Hello
>
> On 19/06/2012 11:11, Zhang, Jingke wrote:
> > Hi all,
> > Does any guys try DUN server with bluez?
> >
> > My telephone stack is ofono and its DUN server code should be ready in its
> commit. However, the problem is my DUN activation request almost did not
> come to ofono side (only to bluez RFCOMM). On the DUN Client, I can use same
> validation step to active a mobile phone (Sony-Ericson C905) to connect to
> 2G/3G network.
> >
> > I filed a bug https://bugs.meego.com/show_bug.cgi?id=25303 to track all
> logs.
> >
> > Could you help to see what's the problem?
> >
> > Thanks
> > Jingke
> > --
> > To unsubscribe from this list: send the line "unsubscribe
> > linux-bluetooth" in the body of a message to [email protected]
> > More majordomo info at http://vger.kernel.org/majordomo-info.html
> >
>
> Your hcidump shows 2 SDP records for DUN profile.
>
> Guillaume Zajac and I found the same problem yesterday, and reply about it on
> oFono mailing list (see "Re: oFono DUN server issue" mails).
>
> It seems that BlueZ was compiled with embedded DUN server (configure
> option --enable-pnat).
> When both BlueZ and oFono are started, they both listen for incoming
> connection on RFCOMM port 1 (try "sdptool browse local" to check), and
> embedded BlueZ DUN server reply preventing oFono to manage this
> connection.
>
> If you remove the embedded DUN server by removing --enable-pnat from build
> configuration, it should work.
>
> Fred
>
> --
> Frederic Danis Open Source Technology
> Center
> [email protected] Intel
> Corporation
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in the
> body of a message to [email protected] More majordomo info at
> http://vger.kernel.org/majordomo-info.html
> --
> To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in the
> body of a message to [email protected] More majordomo info at
> http://vger.kernel.org/majordomo-info.html

2012-06-20 05:24:11

by Zhang, Jingke

[permalink] [raw]
Subject: RE: BT DUN Server fails to work (seems blocked in RFCOMM)

Hi Danis,
I rebuild my bluez again without "--enable-pnat" in bootstrap-configure. Now, my sdp result shows ONLY ONE "Dial-up Networking" service. It is from ofonod.

Retest this case. It reports "Security block" after DUN server gets "Dial-up Networking" record. The hcidump will be attached in bug --- https://bugs.meego.com/show_bug.cgi?id=25303 .
At this time, I tried a FTP case (to prove pairing is OK), FTP passed.

So, I suspect DUN response "security block" may be due to DUN service itself, which is provided by ofonod. Please help to check it. Thanks!

-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Frederic Danis
Sent: Tuesday, June 19, 2012 6:53 PM
To: Zhang, Jingke
Cc: [email protected]
Subject: Re: BT DUN Server fails to work (seems blocked in RFCOMM)

Hello

On 19/06/2012 11:11, Zhang, Jingke wrote:
> Hi all,
> Does any guys try DUN server with bluez?
>
> My telephone stack is ofono and its DUN server code should be ready in its commit. However, the problem is my DUN activation request almost did not come to ofono side (only to bluez RFCOMM). On the DUN Client, I can use same validation step to active a mobile phone (Sony-Ericson C905) to connect to 2G/3G network.
>
> I filed a bug https://bugs.meego.com/show_bug.cgi?id=25303 to track all logs.
>
> Could you help to see what's the problem?
>
> Thanks
> Jingke
> --
> To unsubscribe from this list: send the line "unsubscribe
> linux-bluetooth" in the body of a message to [email protected]
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>

Your hcidump shows 2 SDP records for DUN profile.

Guillaume Zajac and I found the same problem yesterday, and reply about it on oFono mailing list (see "Re: oFono DUN server issue" mails).

It seems that BlueZ was compiled with embedded DUN server (configure option --enable-pnat).
When both BlueZ and oFono are started, they both listen for incoming connection on RFCOMM port 1 (try "sdptool browse local" to check), and embedded BlueZ DUN server reply preventing oFono to manage this connection.

If you remove the embedded DUN server by removing --enable-pnat from build configuration, it should work.

Fred

--
Frederic Danis Open Source Technology Center
[email protected] Intel Corporation

2012-06-19 10:57:18

by Luiz Augusto von Dentz

[permalink] [raw]
Subject: Re: BT DUN Server fails to work (seems blocked in RFCOMM)

Hi Frederic,

On Tue, Jun 19, 2012 at 1:53 PM, Frederic Danis
<[email protected]> wrote:
> Your hcidump shows 2 SDP records for DUN profile.
>
> Guillaume Zajac and I found the same problem yesterday, and reply about it
> on oFono mailing list (see "Re: oFono DUN server issue" mails).
>
> It seems that BlueZ was compiled with embedded DUN server (configure option
> --enable-pnat).
> When both BlueZ and oFono are started, they both listen for incoming
> connection on RFCOMM port 1 (try "sdptool browse local" to check), and
> embedded BlueZ DUN server reply preventing oFono to manage this connection.
>
> If you remove the embedded DUN server by removing --enable-pnat from build
> configuration, it should work.

We should probably try to prevent this duplicate records to even
happen, specially if they use the same channel.

--
Luiz Augusto von Dentz

2012-06-19 10:53:21

by Frederic Danis

[permalink] [raw]
Subject: Re: BT DUN Server fails to work (seems blocked in RFCOMM)

Hello

On 19/06/2012 11:11, Zhang, Jingke wrote:
> Hi all,
> Does any guys try DUN server with bluez?
>
> My telephone stack is ofono and its DUN server code should be ready in its commit. However, the problem is my DUN activation request almost did not come to ofono side (only to bluez RFCOMM). On the DUN Client, I can use same validation step to active a mobile phone (Sony-Ericson C905) to connect to 2G/3G network.
>
> I filed a bug https://bugs.meego.com/show_bug.cgi?id=25303 to track all logs.
>
> Could you help to see what's the problem?
>
> Thanks
> Jingke
> --
> To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
> the body of a message to [email protected]
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>

Your hcidump shows 2 SDP records for DUN profile.

Guillaume Zajac and I found the same problem yesterday, and reply about
it on oFono mailing list (see "Re: oFono DUN server issue" mails).

It seems that BlueZ was compiled with embedded DUN server (configure
option --enable-pnat).
When both BlueZ and oFono are started, they both listen for incoming
connection on RFCOMM port 1 (try "sdptool browse local" to check), and
embedded BlueZ DUN server reply preventing oFono to manage this connection.

If you remove the embedded DUN server by removing --enable-pnat from
build configuration, it should work.

Fred

--
Frederic Danis Open Source Technology Center
[email protected] Intel Corporation


2012-06-19 10:12:31

by Dean Jenkins

[permalink] [raw]
Subject: Re: BT DUN Server fails to work (seems blocked in RFCOMM)

On 19 June 2012 10:48, Zhang, Jingke <[email protected]> wrote:
> Hi Jenkins,
> I saw first SABM interaction seems ok in the hcidump log. Do not know why it has problem in second arrival SABM.
>
> 2012-06-20 17:52:13.037312 > ACL data: handle 12 flags 0x02 dlen 8
> ? ?L2CAP(d): cid 0x0041 len 4 [psm 3]
> ? ? ?RFCOMM(s): SABM: cr 1 dlci 0 pf 1 ilen 0 fcs 0x1c
> 2012-06-20 17:52:13.037473 < ACL data: handle 12 flags 0x00 dlen 8
> ? ?L2CAP(d): cid 0x0041 len 4 [psm 3]
> ? ? ?RFCOMM(s): UA: cr 1 dlci 0 pf 1 ilen 0 fcs 0xd7
> 2012-06-20 17:52:13.064287 > ACL data: handle 12 flags 0x02 dlen 18
> ? ?L2CAP(d): cid 0x0041 len 14 [psm 3]
> ? ? ?RFCOMM(s): PN CMD: cr 1 dlci 0 pf 0 ilen 10 fcs 0x70 mcc_len 8
>
This is establishment of the rfcomm control channel. Each rfcomm
session needs a control channel (channel number zero). The DUN
connection will use a rfcomm data channel (channel number not zero).

You can ask question on IRC chat on irc.freenode.net chat room #bluez.

Dean

--
Dean Jenkins
Embedded Software Engineer
Professional Services UK/EMEA
MontaVista Software, LLC

2012-06-19 09:48:23

by Zhang, Jingke

[permalink] [raw]
Subject: RE: BT DUN Server fails to work (seems blocked in RFCOMM)

Hi Jenkins,
I saw first SABM interaction seems ok in the hcidump log. Do not know why it has problem in second arrival SABM.

2012-06-20 17:52:13.037312 > ACL data: handle 12 flags 0x02 dlen 8
L2CAP(d): cid 0x0041 len 4 [psm 3]
RFCOMM(s): SABM: cr 1 dlci 0 pf 1 ilen 0 fcs 0x1c
2012-06-20 17:52:13.037473 < ACL data: handle 12 flags 0x00 dlen 8
L2CAP(d): cid 0x0041 len 4 [psm 3]
RFCOMM(s): UA: cr 1 dlci 0 pf 1 ilen 0 fcs 0xd7
2012-06-20 17:52:13.064287 > ACL data: handle 12 flags 0x02 dlen 18
L2CAP(d): cid 0x0041 len 14 [psm 3]
RFCOMM(s): PN CMD: cr 1 dlci 0 pf 0 ilen 10 fcs 0x70 mcc_len 8

-----Original Message-----
From: Dean Jenkins [mailto:[email protected]]
Sent: Tuesday, June 19, 2012 5:39 PM
To: Zhang, Jingke
Cc: [email protected]
Subject: Re: BT DUN Server fails to work (seems blocked in RFCOMM)

On 19 June 2012 10:11, Zhang, Jingke <[email protected]> wrote:
> Hi all,
> Does any guys try DUN server with bluez?
>
> My telephone stack is ofono and its DUN server code should be ready in its commit. However, the problem is my DUN activation request almost did not come to ofono side (only to bluez RFCOMM). On the DUN Client, I can use same validation step to active a mobile phone (Sony-Ericson C905) to connect to 2G/3G network.
>
> I filed a bug https://bugs.meego.com/show_bug.cgi?id=25303 to track all logs.
>
> Could you help to see what's the problem?
>
Your hcidump shows:

2012-06-20 17:52:13.092287 > ACL data: handle 12 flags 0x02 dlen 8
L2CAP(d): cid 0x0041 len 4 [psm 3]
RFCOMM(s): SABM: cr 1 dlci 2 pf 1 ilen 0 fcs 0x59
2012-06-20 17:52:15.033302 > ACL data: handle 12 flags 0x02 dlen 12
L2CAP(s): Disconn req: dcid 0x0040 scid 0x0040

rfcomm host side is sending is sending a SABM on DLCI 2. I guess this for the DUN rfcomm channel.

However it can be seen that a L2CAP disconnect request comes from the remote device so requests termination of the L2CAP link. I guess the remote device disconnected the connection for some reason.

> Thanks
> Jingke
> --
> To unsubscribe from this list: send the line "unsubscribe
> linux-bluetooth" in the body of a message to [email protected]
> More majordomo info at ?http://vger.kernel.org/majordomo-info.html

--
Dean Jenkins
Embedded Software Engineer
Professional Services UK/EMEA
MontaVista Software, LLC

2012-06-19 09:39:12

by Dean Jenkins

[permalink] [raw]
Subject: Re: BT DUN Server fails to work (seems blocked in RFCOMM)

On 19 June 2012 10:11, Zhang, Jingke <[email protected]> wrote:
> Hi all,
> Does any guys try DUN server with bluez?
>
> My telephone stack is ofono and its DUN server code should be ready in its commit. However, the problem is my DUN activation request almost did not come to ofono side (only to bluez RFCOMM). On the DUN Client, I can use same validation step to active a mobile phone (Sony-Ericson C905) to connect to 2G/3G network.
>
> I filed a bug https://bugs.meego.com/show_bug.cgi?id=25303 to track all logs.
>
> Could you help to see what's the problem?
>
Your hcidump shows:

2012-06-20 17:52:13.092287 > ACL data: handle 12 flags 0x02 dlen 8
L2CAP(d): cid 0x0041 len 4 [psm 3]
RFCOMM(s): SABM: cr 1 dlci 2 pf 1 ilen 0 fcs 0x59
2012-06-20 17:52:15.033302 > ACL data: handle 12 flags 0x02 dlen 12
L2CAP(s): Disconn req: dcid 0x0040 scid 0x0040

rfcomm host side is sending is sending a SABM on DLCI 2. I guess this
for the DUN rfcomm channel.

However it can be seen that a L2CAP disconnect request comes from the
remote device so requests termination of the L2CAP link. I guess the
remote device disconnected the connection for some reason.

> Thanks
> Jingke
> --
> To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
> the body of a message to [email protected]
> More majordomo info at ?http://vger.kernel.org/majordomo-info.html

--
Dean Jenkins
Embedded Software Engineer
Professional Services UK/EMEA
MontaVista Software, LLC