[PATCH] mesh: Make inactivity timer configurable

Bob Copeland me
Wed Jan 14 18:49:59 PST 2015


On Thu, Jan 15, 2015 at 09:22:31AM +0900, Masashi Honma wrote:
> +	 * Set NL80211_MESHCONF_PLINK_TIMEOUT even if user mpm is used.
> +	 * Because the timer could disconnect stations even if user mpm is used.
> +	 *
> +	 * Set 0xffffffff instead of 0. Because NL80211_MESHCONF_PLINK_TIMEOUT
> +	 * does not allow 0.
> +	 */

How about:

    u32 timeout = params->conf.peer_link_timeout;

    /*
     * Set kernel inactivity timeout to max when unspecified,
     * or when implementing MPM because it may interfere with
     * userspace inactivity timer.
     */
    if (!timeout ||
        (params->conf.flags & WPA_DRIVER_MESH_FLAG_USER_MPM)) {
        timeout = 0xffffffff;
    }

    if (nla_put_u32(msg, NL80211_MESHCONF_PLINK_TIMEOUT, timeout)) {
        ...
    }

This is what I meant about pulling out the inner conditional -- you
can still run the nla_put_u32 unconditionally, but this makes it more
obvious what's going on compared to putting a ternary operator inside
the function call parameter.

-- 
Bob Copeland %% http://bobcopeland.com/



More information about the Hostap mailing list