isolating cause of ticket 5848

Javier Cardona javier at cozybit.com
Tue Jun 10 20:27:56 EDT 2008


Bill,

On Tue, Jun 10, 2008 at 2:25 PM, Bill Mccormick <billmcc at nortel.com> wrote:
> Hey guys,
>
> I've tracked down some of the code that's causing this problem.  (the
> syslog file is invaluable for debugging nm problems in case you have to
> do this again).   NM is waiting for a netlink callback, specifically in
> nm-device-802-11-mesh-olpc.c on lines 291-307.   when NM doesn't get the
> expected callback a timer (called the association timer) expires and NM
> stops trying to setup the P2P mesh.
>
> <snip>
>                if (iwe->cmd == SIOCGIWAP) {
>                        addr = iwe->u.ap_addr.sa_data;
>                        if (   !memcmp (addr, badaddr1, ETH_ALEN)
>                            || !memcmp (addr, badaddr2, ETH_ALEN)
>                            || !memcmp (addr, badaddr3, ETH_ALEN)) {
>                                /* disassociated */
>                        } else {
>                                /* associated */
>                                GSource * source = g_idle_source_new ();
>                                if (source) {
> nm_info ("%s: Got association; scheduling association handler",
> nm_device_get_iface (NM_DEVICE (self)));
>                                        g_object_ref (self);
>                                        g_source_set_priority (source,
> G_PRIORITY_HIGH_IDLE);
>                                        g_source_set_callback (source,
> handle_association_event, self, NULL);
>                                        g_source_attach (source,
> nm_device_get_main_context (NM_DEVICE (self)));
>                                        g_source_unref (source);
>                                }
>                        }
> </snip>
>
> handle_association_event() cancels the association timer, so if this
> SIOCGIWAP message isn't received, or is received with an 'invalid' MAC,
> then the timer never gets cancelled and NM gives up on the mesh setup.
>
> Looking at the wireless.h header file, it looks like SIOCGIWAP is
> normally used to get access point MAC addresses.   In this guess, I
> think the NM is expecting to get the MAC address of msh0.
>
> Now it gets kinda confusing here.   The SIOCGIWAP isn't actually used in
> an ioctl() function, rather this is a message delivered via netlink and
> SIOCGIWAP is the value of the iw_event.cmd field (see wireless.h again).
>
> Javier, could you advise what this message is used for on the mesh
> interface?

This is the first time I look into this, but inspecting the driver I
see that this event is sent:

1. [cmdrsp.c:44] when association is lost (MAC set to all zeros)
2. [join.c:232] when successfully joined an ad-hoc network (MAC set to BSSID)
3. [join.c:789] when successfully associated (MAC set to BSSID)
4. [join.c:874] when starting and ad-hoc netwrok (MAC set to BSSID)
5. [main.c:1202] when removing the interface (MAC set to all 0xaa's)

As far as I can tell, there is no SIOCGIWAP event generated by the
mesh interface, as the mesh interface is always on.

Javier

-- 
Javier Cardona
cozybit Inc.



More information about the Devel mailing list