• Anjali Kulkarni's avatar
    connector/cn_proc: Add filtering to fix some bugs · 2aa1f7a1
    Anjali Kulkarni authored
    The current proc connector code has the foll. bugs - if there are more
    than one listeners for the proc connector messages, and one of them
    deregisters for listening using PROC_CN_MCAST_IGNORE, they will still get
    all proc connector messages, as long as there is another listener.
    
    Another issue is if one client calls PROC_CN_MCAST_LISTEN, and another one
    calls PROC_CN_MCAST_IGNORE, then both will end up not getting any messages.
    
    This patch adds filtering and drops packet if client has sent
    PROC_CN_MCAST_IGNORE. This data is stored in the client socket's
    sk_user_data. In addition, we only increment or decrement
    proc_event_num_listeners once per client. This fixes the above issues.
    
    cn_release is the release function added for NETLINK_CONNECTOR. It uses
    the newly added netlink_release function added to netlink_sock. It will
    free sk_user_data.
    Signed-off-by: default avatarAnjali Kulkarni <anjali.k.kulkarni@oracle.com>
    Reviewed-by: default avatarLiam R. Howlett <Liam.Howlett@oracle.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    2aa1f7a1
w1_netlink.c 18.9 KB