08 Apr, 2016

1 commit

  • When enabling a bearer we create a 'neigbor discoverer' instance by
    calling the function tipc_disc_create() before the bearer is actually
    registered in the list of enabled bearers. Because of this, the very
    first discovery broadcast message, created by the mentioned function,
    is lost, since it cannot find any valid bearer to use. Furthermore,
    the used send function, tipc_bearer_xmit_skb() does not free the given
    buffer when it cannot find a bearer, resulting in the leak of exactly
    one send buffer each time a bearer is enabled.

    This commit fixes this problem by introducing two changes:

    1) Instead of attemting to send the discovery message directly, we let
    tipc_disc_create() return the discovery buffer to the calling
    function, tipc_enable_bearer(), so that the latter can send it
    when the enabling sequence is finished.

    2) In tipc_bearer_xmit_skb(), as well as in the two other transmit
    functions at the bearer layer, we now free the indicated buffer or
    buffer chain when a valid bearer cannot be found.

    Acked-by: Ying Xue
    Signed-off-by: Jon Maloy
    Signed-off-by: David S. Miller

    Jon Paul Maloy
     

13 Jan, 2015

1 commit

  • Involve namespace infrastructure, make the "tipc_net_id" global
    variable aware of per namespace, and rename it to "net_id". In
    order that the conversion can be successfully done, an instance
    of networking namespace must be passed to relevant functions,
    allowing them to access the "net_id" variable of per namespace.

    Signed-off-by: Ying Xue
    Tested-by: Tero Aho
    Reviewed-by: Jon Maloy
    Signed-off-by: David S. Miller

    Ying Xue
     

23 Apr, 2014

1 commit

  • Commit a21a584d6720ce349b05795b9bcfab3de8e58419 (tipc: fix neighbor
    detection problem after hw address change) introduces a race condition
    involving tipc_disc_delete() and tipc_disc_add/remove_dest that can
    cause TIPC to dereference the pointer to the bearer discovery request
    structure after it has been freed since a stray pointer is left in the
    bearer structure.

    In order to fix the issue, the process of resetting the discovery
    request handler is optimized: the discovery request handler and request
    buffer are just reset instead of being freed, allocated and initialized.
    As the request point is always valid and the request's lock is taken
    while the request handler is reset, the race doesn't happen any more.

    Reported-by: Erik Hugne
    Signed-off-by: Ying Xue
    Reviewed-by: Erik Hugne
    Tested-by: Erik Hugne
    Signed-off-by: David S. Miller

    Ying Xue
     

29 Mar, 2014

1 commit

  • The node discovery domain is assigned when a bearer is enabled.
    In the previous commit we reflect this attribute directly in the
    bearer structure since it's needed to reinitialize the node
    discovery mechanism after a hardware address change.

    There's no need to replicate this attribute anywhere else, so we
    remove it from the tipc_link_req structure.

    Signed-off-by: Erik Hugne
    Reviewed-by: Ying Xue
    Signed-off-by: David S. Miller

    Erik Hugne
     

19 Feb, 2014

1 commit

  • Rename the following functions, which are shorter and more in line
    with common naming practice in the network subsystem.

    tipc_bclink_send_msg->tipc_bclink_xmit
    tipc_bclink_recv_pkt->tipc_bclink_rcv
    tipc_disc_recv_msg->tipc_disc_rcv
    tipc_link_send_proto_msg->tipc_link_proto_xmit
    link_recv_proto_msg->tipc_link_proto_rcv
    link_send_sections_long->tipc_link_iovec_long_xmit
    tipc_link_send_sections_fast->tipc_link_iovec_xmit_fast
    tipc_link_send_sync->tipc_link_sync_xmit
    tipc_link_recv_sync->tipc_link_sync_rcv
    tipc_link_send_buf->__tipc_link_xmit
    tipc_link_send->tipc_link_xmit
    tipc_link_send_names->tipc_link_names_xmit
    tipc_named_recv->tipc_named_rcv
    tipc_link_recv_bundle->tipc_link_bundle_rcv
    tipc_link_dup_send_queue->tipc_link_dup_queue_xmit
    link_send_long_buf->tipc_link_frag_xmit

    tipc_multicast->tipc_port_mcast_xmit
    tipc_port_recv_mcast->tipc_port_mcast_rcv
    tipc_port_reject_sections->tipc_port_iovec_reject
    tipc_port_recv_proto_msg->tipc_port_proto_rcv
    tipc_connect->tipc_port_connect
    __tipc_connect->__tipc_port_connect
    __tipc_disconnect->__tipc_port_disconnect
    tipc_disconnect->tipc_port_disconnect
    tipc_shutdown->tipc_port_shutdown
    tipc_port_recv_msg->tipc_port_rcv
    tipc_port_recv_sections->tipc_port_iovec_rcv

    release->tipc_release
    accept->tipc_accept
    bind->tipc_bind
    get_name->tipc_getname
    poll->tipc_poll
    send_msg->tipc_sendmsg
    send_packet->tipc_send_packet
    send_stream->tipc_send_stream
    recv_msg->tipc_recvmsg
    recv_stream->tipc_recv_stream
    connect->tipc_connect
    listen->tipc_listen
    shutdown->tipc_shutdown
    setsockopt->tipc_setsockopt
    getsockopt->tipc_getsockopt

    Above changes have no impact on current users of the functions.

    Signed-off-by: Ying Xue
    Reviewed-by: Jon Maloy
    Signed-off-by: David S. Miller

    Ying Xue
     

30 Dec, 2011

1 commit


11 May, 2011

2 commits

  • Augments TIPC's discovery object to track the number of neighboring nodes
    having an active link to the associated bearer.

    This means tipc_disc_update_link_req() becomes either one of:

    tipc_disc_add_dest()
    or:
    tipc_disc_remove_dest()

    depending on the code flow direction of things.

    Signed-off-by: Allan Stephens
    Signed-off-by: Paul Gortmaker

    Allan Stephens
     
  • Modifies bearer creation and deletion code to improve handling of
    scenarios when a neighbor discovery object cannot be created. The
    creation routine now aborts the creation of a bearer if its discovery
    object cannot be created, and deletes the newly created bearer, rather
    than failing quietly and leaving an unusable bearer hanging around.

    Since the exit via the goto label really isn't a definitive failure
    in all cases, relabel it appropriately.

    Signed-off-by: Allan Stephens
    Signed-off-by: Paul Gortmaker

    Allan Stephens
     

24 Feb, 2011

2 commits

  • Eliminates support for the "number of requested links" field in a neighbor
    discovery message. This field was never used and has been removed from
    the TIPC 2.0 protocol specification.

    Signed-off-by: Allan Stephens
    Signed-off-by: Paul Gortmaker

    Allan Stephens
     
  • Combines two distinct structures containing information about a TIPC bearer
    into a single structure. The structures were previously kept separate so
    that public information about a bearer could be made available to plug-in
    media types using TIPC's native API, while the remaining information was
    kept private for use by TIPC itself. However, now that the native API has
    been removed there is no longer any need for this arrangement.

    Since one of the structures was already embedded within the other, the
    change largely involves replacing instances of "publ.foo" with "foo".
    The changes do not otherwise alter the operation of TIPC bearers.

    Signed-off-by: Allan Stephens
    Signed-off-by: Paul Gortmaker

    Allan Stephens
     

03 Dec, 2010

1 commit


17 Oct, 2010

1 commit

  • Do some cleanups of TIPC based on make namespacecheck
    1. Don't export unused symbols
    2. Eliminate dead code
    3. Make functions and variables local
    4. Rename buf_acquire to tipc_buf_acquire since it is used in several files

    Compile tested only.
    This make break out of tree kernel modules that depend on TIPC routines.

    Signed-off-by: Stephen Hemminger
    Acked-by: Jon Maloy
    Acked-by: Paul Gortmaker
    Signed-off-by: David S. Miller

    stephen hemminger
     

14 Oct, 2010

1 commit

  • Remove all instances of legacy, or as yet to be implemented code
    that is currently living within an #if 0 ... #endif block.
    In the rare instance that some of it be needed in the future,
    it can still be dragged out of history, but there is no need
    for it to sit in mainline.

    Signed-off-by: Paul Gortmaker
    Acked-by: Neil Horman
    Signed-off-by: David S. Miller

    Paul Gortmaker