Send connman mailing list submissions to
[email protected]
To subscribe or unsubscribe via the World Wide Web, visit
https://lists.01.org/mailman/listinfo/connman
or, via email, send a message with subject or body 'help' to
[email protected]
You can reach the person managing the list at
[email protected]
When replying, please edit your Subject line so it is more specific
than "Re: Contents of connman digest..."
Today's Topics:
1. RE: Not sure how to fix this bug (Thomas Green)
2. Re: Connman on Android/Brillo (Naveen Singh)
3. Re: Connman on Android/Brillo (Naveen Singh)
----------------------------------------------------------------------
Message: 1
Date: Fri, 26 Aug 2016 22:28:11 +0000
From: Thomas Green <[email protected]>
To: "[email protected]" <[email protected]>
Subject: RE: Not sure how to fix this bug
Message-ID:
<c2bc44d770753c45aaac42695fb5be0201255ab...@slc-exmb01.corp.srelay.com>
Content-Type: text/plain; charset="us-ascii"
Sorry to follow up my own post, but as no one answered, I am attaching my own
proposed fix. If this looks ok, let me know.
Tom
From: connman [mailto:[email protected]] On Behalf Of Thomas Green
Sent: Thursday, August 25, 2016 4:29 PM
To: [email protected]
Subject: Not sure how to fix this bug
In connman 1.33 I have come up with an interesting scenario, and am not sure
how to fix it. The easiest way to duplicate it is to plug my wired connection
into a switch that is turned on, but does -not- have the uplink cable plugged
in. After the DHCP request fails, there is some (random?) address assigned
(169.254.x.x). At that point the uplink cable on the switch is plugged in.
When a DHCP solicitation is sent again, and an answer is received, connman gets
the information, but does not send the new nameserver information. Attached is
a copy of the debug log I have, and at about line 149 you see where the
nameservers are saved. But after that, they are all used internally, but my
application does not get a PropertyChanged signal indicating the change.
It seems to me it would be a quick fix but I'm not sure where is the best place
to do it.
Thank you for your help
Tom
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://lists.01.org/pipermail/connman/attachments/20160826/c18a61d5/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: fix_connman_not_sending_nameservers.patch
Type: application/octet-stream
Size: 1097 bytes
Desc: fix_connman_not_sending_nameservers.patch
URL:
<http://lists.01.org/pipermail/connman/attachments/20160826/c18a61d5/attachment-0001.obj>
------------------------------
Message: 2
Date: Fri, 26 Aug 2016 17:17:58 -0700
From: Naveen Singh <[email protected]>
To: Patrik Flykt <[email protected]>
Cc: [email protected]
Subject: Re: Connman on Android/Brillo
Message-ID:
<CAEwPxKYVkdKW=mmZnDVv_VmHF=0amzdesglvpz8nbcy6csn...@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"
Hey Patrik
Sorry for a delayed reply. Thanks for all the pointers. I have started
working on this. This is what I was planning to do:
In configure.ac look for --host (configure option) containing android or
not. If it is containing android we know we are going to use bionic and we
can make some variable true (like HAVE_BIONIC = true) and that can go into
config.h and we can use that as a pre-processor directive to distinguish
the code.
Is this in line with your thought process?
Regards
On Tue, Aug 9, 2016 at 3:35 AM, Patrik Flykt <[email protected]>
wrote:
>
> Hi,
>
> On Fri, 2016-07-15 at 18:21 -0700, Naveen Singh wrote:
> > I had this talk with Marcel few weeks back about compiling connman on
> > Android/Brillo. This would surely give connman the penetration into
> > Android world and future IoT devices which are based of Brillo.
> >
> > I actually got it compiled and working. There are two challenges:
> >
> > a) Some of the libraries that are required by connman are missing.
> > For
> > my work I got those libraries compiled first.
> >
> > b) Changes in connman itself: Open source connman does not compile as
> > such for Android/Brillo. There are some changes needed in connman to
> > get this going. I would like to see if we can upstream these changes.
> >
> > The intent of this email is to discuss those changes. Following are
> > the changes needed:
> >
> > 1) Backtrace system call: In log.c from function print_backtrace we
> > call backtrace. It is a glibc API and is no present in bionic. There
> > is an equivalent function in bionic for doing this.
>
> Backtrace printing was moved to its own file, src/backtrace.c, in
> ConnMan 1.32, so this is just an automake check away.
>
> > 2) hard check for ns_initparse in libresolv.so: There is no
> > libresolv.so for android/Brillo. All these ns_* symbols are part of
> > libc.so. So hard check has to go. We may need to check in
> > configure.ac
> > whether we are compiling against glibc or bionic early on and do
> > stuff
> > differently.
>
> Yes, some automake magic needed.
>
> > 3) NTP code calls adjtime to adjust clock. This function is missing
> > in
> > bionic. We may need to find a similar function in bionic for doing
> > this.
>
> The adjtimex patch on the ml will probably solve this. I'll take a look
> at that patch nextish.
>
> > 4) struct in6_pktinfo is defined in connman code (file
> > gdhcp/common.h)
> > under #ifndef __USE_GNU. Now this structure is defined in bionic
> > header file libc/kernel/uapi/ipv6.h. Not sure what is the intent of
> > #ifndef __USE_GNU? Should this go away? Similarly struct in6_ifreq is
> > defined in inet.c file and it is also defined in the same bionic
> > header file. I had to comment out this definition to compile connman.
>
> See commit message for e8784053a0a680ec8943ff20559c6561cb5b9a96.
> For struct in6_ifreq it looks like very old code that should be fixed.
>
> > 5) Some of the structures which are needed for connman compilation
> > are
> > defined under #ifdef __USE_BSD in bionic header file. For Bionic
> > __USE_BSD is defined only if _GNU_SOURCE is defined. So for those
> > files in connman we have to define _GNU_SOURCE as the first line in
> > that file. Example is ipv4ll.c. I hope this should be OK.
>
> I'd like to keep the files as clean as possible. Looking at autoconf
> magic, it seems to be possible to use AC_DEFINE to add values to the
> generated config.h file, which is included first. config.h is used
> everywhere and should be the first file included. So could one add the
> needed defines in order to config.h with AC_DEFINE instead? And/or the
> use of bionic, if needed?
>
> > 6) GResolv structure in gresolv.c: struct __res_state is a member for
> > GResolv structure. This structure is defined in resolv.h file in
> > glibc. struct __res_state in bionic requires inclusion of two other
> > header files resolv_private.h and res_private. Also this structure is
> > defined very differently between bionic and glibc. This caused
> > changes
> > in gresolv.c, the way it accesses various members of this structure.
>
> Ok, sounds a bit more complicated. You should perhaps post an RFC patch
> for this so we have an idea of how complicated it becomes.
>
> > 7) Struct sockaddr_in6 defined differently b/w bionic and glibc.
>
> What is the difference here? Something that does not compile on both
> "platforms"?
>
> > 8) ETH_ALEN is not defined in bionic header file
>
> Should be easy once we know bionic is being used.
>
> > 9) Need to include resolv_params.h in resolver.c. This is because
> > "MAXDNSRCH" etc is defined in resolv_params.h in bionic.
>
> Automake/conf magic, I hope.
>
> > 10) Needed to remove "-lresolv -lrt" from Makefile.am.
>
> As above, I hope.
>
> > Some of these changes are easily doable if we can have #ifdef ANDROID
> > in code. Through configure.ac we can detect if we are compiling
> > against bionic or glibc and appropriately turn on this flag. Not sure
> > what your thought are on this.
>
> I'd go for configure.ac, it makes the code cleaner and uses
> autoconf/automake for it's intended purpose. Let's start with the easy
> parts first.
>
> Thanks for the heads up!
>
>
> Patrik
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://lists.01.org/pipermail/connman/attachments/20160826/d154f90d/attachment-0001.html>
------------------------------
Message: 3
Date: Fri, 26 Aug 2016 17:35:55 -0700
From: Naveen Singh <[email protected]>
To: Patrik Flykt <[email protected]>
Cc: [email protected]
Subject: Re: Connman on Android/Brillo
Message-ID:
<CAEwPxKa2eFqdvoJ7yWRjj7hcLV2RrjKC=pwq146iwkjyfrh...@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"
On Tue, Aug 9, 2016 at 3:35 AM, Patrik Flykt <[email protected]>
wrote:
>
> Hi,
>
> On Fri, 2016-07-15 at 18:21 -0700, Naveen Singh wrote:
> > I had this talk with Marcel few weeks back about compiling connman on
> > Android/Brillo. This would surely give connman the penetration into
> > Android world and future IoT devices which are based of Brillo.
> >
> > I actually got it compiled and working. There are two challenges:
> >
> > a) Some of the libraries that are required by connman are missing.
> > For
> > my work I got those libraries compiled first.
> >
> > b) Changes in connman itself: Open source connman does not compile as
> > such for Android/Brillo. There are some changes needed in connman to
> > get this going. I would like to see if we can upstream these changes.
> >
> > The intent of this email is to discuss those changes. Following are
> > the changes needed:
> >
> > 1) Backtrace system call: In log.c from function print_backtrace we
> > call backtrace. It is a glibc API and is no present in bionic. There
> > is an equivalent function in bionic for doing this.
>
> Backtrace printing was moved to its own file, src/backtrace.c, in
> ConnMan 1.32, so this is just an automake check away.
>
> > 2) hard check for ns_initparse in libresolv.so: There is no
> > libresolv.so for android/Brillo. All these ns_* symbols are part of
> > libc.so. So hard check has to go. We may need to check in
> > configure.ac
> > whether we are compiling against glibc or bionic early on and do
> > stuff
> > differently.
>
> Yes, some automake magic needed.
>
> > 3) NTP code calls adjtime to adjust clock. This function is missing
> > in
> > bionic. We may need to find a similar function in bionic for doing
> > this.
>
> The adjtimex patch on the ml will probably solve this. I'll take a look
> at that patch nextish.
>
> > 4) struct in6_pktinfo is defined in connman code (file
> > gdhcp/common.h)
> > under #ifndef __USE_GNU. Now this structure is defined in bionic
> > header file libc/kernel/uapi/ipv6.h. Not sure what is the intent of
> > #ifndef __USE_GNU? Should this go away? Similarly struct in6_ifreq is
> > defined in inet.c file and it is also defined in the same bionic
> > header file. I had to comment out this definition to compile connman.
>
> See commit message for e8784053a0a680ec8943ff20559c6561cb5b9a96.
> For struct in6_ifreq it looks like very old code that should be fixed.
>
> > 5) Some of the structures which are needed for connman compilation
> > are
> > defined under #ifdef __USE_BSD in bionic header file. For Bionic
> > __USE_BSD is defined only if _GNU_SOURCE is defined. So for those
> > files in connman we have to define _GNU_SOURCE as the first line in
> > that file. Example is ipv4ll.c. I hope this should be OK.
>
> I'd like to keep the files as clean as possible. Looking at autoconf
> magic, it seems to be possible to use AC_DEFINE to add values to the
> generated config.h file, which is included first. config.h is used
> everywhere and should be the first file included. So could one add the
> needed defines in order to config.h with AC_DEFINE instead? And/or the
> use of bionic, if needed?
>
> > 6) GResolv structure in gresolv.c: struct __res_state is a member for
> > GResolv structure. This structure is defined in resolv.h file in
> > glibc. struct __res_state in bionic requires inclusion of two other
> > header files resolv_private.h and res_private. Also this structure is
> > defined very differently between bionic and glibc. This caused
> > changes
> > in gresolv.c, the way it accesses various members of this structure.
>
> Ok, sounds a bit more complicated. You should perhaps post an RFC patch
> for this so we have an idea of how complicated it becomes.
>
> > 7) Struct sockaddr_in6 defined differently b/w bionic and glibc.
>
> What is the difference here? Something that does not compile on both
> "platforms"?
>
> > 8) ETH_ALEN is not defined in bionic header file
>
> Should be easy once we know bionic is being used.
>
> > 9) Need to include resolv_params.h in resolver.c. This is because
> > "MAXDNSRCH" etc is defined in resolv_params.h in bionic.
>
> Automake/conf magic, I hope.
>
> > 10) Needed to remove "-lresolv -lrt" from Makefile.am.
>
> As above, I hope.
>
> > Some of these changes are easily doable if we can have #ifdef ANDROID
> > in code. Through configure.ac we can detect if we are compiling
> > against bionic or glibc and appropriately turn on this flag. Not sure
> > what your thought are on this.
>
> I'd go for configure.ac, it makes the code cleaner and uses
> autoconf/automake for it's intended purpose. Let's start with the easy
> parts first.
>
> Thanks for the heads up!
>
> Patrik
>
Something like this: (it may not be syntactically correct)
with_android=no
AC_MSG_CHECKING([checking for android])
case "${host}" in
*android*)
with_android=yes
;;
*)
AM_CONDITIONAL([BIONIC], [test "${with_android}" = "yes"])
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://lists.01.org/pipermail/connman/attachments/20160826/f42fd779/attachment.html>
------------------------------
Subject: Digest Footer
_______________________________________________
connman mailing list
[email protected]
https://lists.01.org/mailman/listinfo/connman
------------------------------
End of connman Digest, Vol 10, Issue 34
***************************************