After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 727119 - wrong IN6_IS_ADDR_MC_LINKLOCAL usage break android build
wrong IN6_IS_ADDR_MC_LINKLOCAL usage break android build
Status: RESOLVED FIXED
Product: glib
Classification: Platform
Component: network
2.40.x
Other Linux
: Normal normal
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2014-03-26 23:49 UTC by Olivier Crête
Modified: 2014-03-31 20:24 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
networkmonitornetlink: IN6_IS_ADDR_MC_LINKLOCAL is only guaranteed to work on struct in6_addr* (1.31 KB, patch)
2014-03-26 23:49 UTC, Olivier Crête
accepted-commit_now Details | Review
networkmonitornetlink: IN6_IS_ADDR_MC_LINKLOCAL is only guaranteed to work on struct in6_addr* (1.26 KB, patch)
2014-03-30 05:56 UTC, Olivier Crête
accepted-commit_now Details | Review

Description Olivier Crête 2014-03-26 23:49:29 UTC
Created attachment 273034 [details] [review]
networkmonitornetlink: IN6_IS_ADDR_MC_LINKLOCAL is only  guaranteed to work on  struct in6_addr*

IN6_IS_ADDR_MC_LINKLOCAL can only be used on a struct in6_addr*, but GLib now tries to use it on an array. It breaks on android. Attaching a patch where I just copied the glibc macro into there.
Comment 1 Olivier Crête 2014-03-26 23:50:35 UTC
Btw, Android is correct here, this is how it is defined in RFC 2553
Comment 2 Dan Winship 2014-03-27 14:10:54 UTC
Comment on attachment 273034 [details] [review]
networkmonitornetlink: IN6_IS_ADDR_MC_LINKLOCAL is only  guaranteed to work on  struct in6_addr*

ok to commit to master and glib-2-40, but can you add a comment explaining:

  /* IN6_IS_ADDR_MC_LINKLOCAL() is only defined to work on struct in6_addr *,
   * but @data may not be aligned correctly to be cast to that.
   */

or maybe just rename the macro to UNALIGNED_IN6_IS_ADDR_MC_LINKLOCAL?

Actually, you can merge the two macros together too. No need for the separate MULTICAST one.
Comment 3 Olivier Crête 2014-03-30 05:56:13 UTC
Created attachment 273268 [details] [review]
networkmonitornetlink: IN6_IS_ADDR_MC_LINKLOCAL is only guaranteed to work on struct in6_addr*

Here is an updated patch, I also much simplified the macro by removing the unnecessary typecasting
Comment 4 Olivier Crête 2014-03-31 20:24:26 UTC
Pushed to master

commit 638993f5ac9be841c4fc932ca768d26840dd6be6
Author: Olivier Crête <olivier.crete@collabora.com>
Date:   Wed Mar 26 19:45:52 2014 -0400

    networkmonitornetlink: IN6_IS_ADDR_MC_LINKLOCAL is only guaranteed to work o
    
    https://bugzilla.gnome.org/show_bug.cgi?id=727119


and glib-2-40

commit c7a661988eb8fd18fb02565d83f52b0136fd3e85
Author: Olivier Crête <olivier.crete@collabora.com>
Date:   Wed Mar 26 19:45:52 2014 -0400

    networkmonitornetlink: IN6_IS_ADDR_MC_LINKLOCAL is only guaranteed to work o
    
    https://bugzilla.gnome.org/show_bug.cgi?id=727119