• Ying Xue's avatar
    tipc: make bearer set up in module insertion stage · 970122fd
    Ying Xue authored
    Accidentally a side effect is involved by commit 6e967adf(tipc:
    relocate common functions from media to bearer). Now tipc stack
    handler of receiving packets from netdevices as well as netdevice
    notification handler are registered when bearer is enabled rather
    than tipc module initialization stage, but the two handlers are
    both unregistered in tipc module exit phase. If tipc module is
    inserted and then immediately removed, the following warning
    message will appear:
    
    "dev_remove_pack: ffffffffa0380940 not found"
    
    This is because in module insertion stage tipc stack packet handler
    is not registered at all, but in module exit phase dev_remove_pack()
    needs to remove it. Of course, dev_remove_pack() cannot find tipc
    protocol handler from the kernel protocol handler list so that the
    warning message is printed out.
    
    But if registering the two handlers is adjusted from enabling bearer
    phase into inserting module stage, the warning message will be
    eliminated. Due to this change, tipc_core_start_net() and
    tipc_core_stop_net() can be deleted as well.
    Reported-by: default avatarWang Weidong <wangweidong1@huawei.com>
    Cc: Jon Maloy <jon.maloy@ericsson.com>
    Cc: Erik Hugne <erik.hugne@ericsson.com>
    Signed-off-by: default avatarYing Xue <ying.xue@windriver.com>
    Reviewed-by: default avatarPaul Gortmaker <paul.gortmaker@windriver.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    970122fd
core.h 6.25 KB