aboutsummaryrefslogtreecommitdiffstats
path: root/net/tipc
Commit message (Collapse)AuthorAgeFilesLines
* tipc: Use genl_register_family_with_ops()Michał Mirosław2009-05-211-22/+16
| | | | | | | | | Use genl_register_family_with_ops() instead of a copy. This also changes netlink related variable names to be kernel-wide unique for consistency with other users. Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl> Signed-off-by: David S. Miller <davem@davemloft.net>
* net: remove needless (now buggy) & from dev->dev_addrJiri Pirko2009-05-171-1/+1
| | | | | | | | Patch fixes issues with dev->dev_addr changing from array to pointer. Hopefully there are no others. Signed-off-by: Jiri Pirko <jpirko@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* tipc: fix non-const printf format argumentsStephen Hemminger2009-03-184-5/+5
| | | | | | | | Fix warnings from current gcc about using non-const strings as printf args in TIPC. Compile tested only (not a TIPC user). Signed-off-by: Stephen Hemminger <shemminger@vyatta.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* net/tipc/bcast.h: use ARRAY_SIZEJulia Lawall2009-01-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | ARRAY_SIZE is more concise to use when the size of an array is divided by the size of its type or the size of its first element. The semantic patch that makes this change is as follows: (http://www.emn.fr/x-info/coccinelle/) // <smpl> @i@ @@ #include <linux/kernel.h> @depends on i using "paren.iso"@ type T; T[] E; @@ - (sizeof(E)/sizeof(T)) + ARRAY_SIZE(E) // </smpl> Signed-off-by: Julia Lawall <julia@diku.dk> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: David S. Miller <davem@davemloft.net>
* tipc: trivial endian annotation in debug statementHarvey Harrison2008-11-071-1/+1
| | | | | | | | Use htonl rather than ntohl on a u32. net/tipc/name_table.c:557:2: warning: cast to restricted __be32 Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* net: convert print_mac to %pMJohannes Berg2008-10-271-2/+1
| | | | | | | | | | | | This converts pretty much everything to print_mac. There were a few things that had conflicts which I have just dropped for now, no harm done. I've built an allyesconfig with this and looked at the files that weren't built very carefully, but it's a huge patch. Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: David S. Miller <davem@davemloft.net>
* tipc: Don't use structure names which easily globally conflict.David S. Miller2008-09-0219-117/+117
| | | | | | | | | | | Andrew Morton reported a build failure on sparc32, because TIPC uses names like "struct node" and there is a like named data structure defined in linux/node.h This just regexp replaces "struct node*" to "struct tipc_node*" to avoid this and any future similar problems. Signed-off-by: David S. Miller <davem@davemloft.net>
* net/tipc/subscr.c: don't use ___constant_swab32Andrew Morton2008-08-131-1/+1
| | | | | | | | | | | It's an internal implementation detail which we _should_ be free to change. So we did, and it promptly broke. The compiler shold be able to work out when to use the __constant version anyway. Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: David S. Miller <davem@davemloft.net>
* netns: Use net_eq() to compare net-namespaces for optimization.YOSHIFUJI Hideaki2008-07-191-2/+2
| | | | | | | | Without CONFIG_NET_NS, namespace is always &init_net. Compiler will be able to omit namespace comparisons with this patch. Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org> Signed-off-by: David S. Miller <davem@davemloft.net>
* tipc: Optimization to multicast name lookup algorithmAllan Stephens2008-07-141-13/+30
| | | | | | | | | | | | | | | This patch simplifies and speeds up TIPC's algorithm for identifying on-node and off-node destinations that overlap a multicast name sequence range. Rather than traversing the list of all known name publications within the cluster, it now traverses the (potentially much shorter) list of name publications made by the node itself, and determines if any off-node destinations exist by comparing the sizes of the two lists. (Since the node list must be a subset of the cluster list, a difference in sizes means that at least one off-node destination must exist.) Signed-off-by: Allan Stephens <allan.stephens@windriver.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* tipc: Add missing locks when inspecting node list & link listAllan Stephens2008-07-141-5/+24
| | | | | | | | | | This patch ensures that TIPC configuration commands that display info about neighboring nodes and their links take the spinlocks that protect the node list and link lists from changing while the lists are being traversed. Signed-off-by: Allan Stephens <allan.stephens@windriver.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* tipc: Fix bug in scope checking for multicast messagesAllan Stephens2008-07-141-2/+4
| | | | | | | | | | | | | This patch ensures that TIPC's multicast message name lookup algorithm does individualized scope checking for each published name it examines. Previously, scope checking was only done for the first name in a name table publication list, which could result in incoming multicast messages being delivered to ports publishing names with "node" scope, or not being delivered to ports publishing names with "cluster" or "zone" scope. Signed-off-by: Allan Stephens <allan.stephens@windriver.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* tipc: Eliminate improper use of TIPC_OK error codeAllan Stephens2008-07-149-49/+49
| | | | | | | | | | | This patch corrects many places where TIPC routines indicated successful completion by returning TIPC_OK instead of 0. (The TIPC_OK symbol has the value 0, but it should only be used in contexts that deal with the error code field of a TIPC message header.) Signed-off-by: Allan Stephens <allan.stephens@windriver.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* tipc: Fix race condition that could cause accept() to failAllan Stephens2008-07-141-20/+22
| | | | | | | | | | | | | | This patch ensurs that accept() returns successfully even when the newly created socket is immediately disconnected by its peer. Previously, accept() would fail if it was unable to pass back the optional address info for the socket's peer before the socket became disconnected; TIPC now allows accept() to gather peer address information after disconnection. As a bonus, the revised code accesses the socket's port more efficiently, without the overhead incurred by a reference table lookup. Signed-off-by: Allan Stephens <allan.stephens@windriver.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* tipc: Optimize pointer dereferencing when receiving stream dataAllan Stephens2008-07-141-1/+1
| | | | | | | | This patch eliminates an unnecessary pointer dereference when accessing a stream-based socket's receive queue. Signed-off-by: Allan Stephens <allan.stephens@windriver.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* tipc: Remove unneeded parameter to tipc_createport_raw()Allan Stephens2008-07-142-26/+17
| | | | | | | | | | This patch eliminates an unneeded parameter when creating a low-level TIPC port object. Instead of returning both the pointer to the port structure and the port's reference ID, it now returns only the pointer since the port structure contains the reference ID as one of its fields. Signed-off-by: Allan Stephens <allan.stephens@windriver.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* tipc: Message rejection rework preparatory changesAllan Stephens2008-06-043-4/+31
| | | | | | | | | This patch defines a few new message header manipulation routines, and generalizes the usefulness of another, in preparation for upcoming rework of TIPC's message rejection code. Signed-off-by: Allan Stephens <allan.stephens@windriver.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* tipc: Fix bugs in rejection of message with short headerAllan Stephens2008-06-041-4/+6
| | | | | | | | This patch ensures that TIPC doesn't try to access non-existent message header fields when rejecting a message with a short header. Signed-off-by: Allan Stephens <allan.stephens@windriver.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* tipc: Message header creation optimizationsAllan Stephens2008-06-041-6/+1
| | | | | | | | This patch eliminates several cases where message header fields were being set to the same value twice. Signed-off-by: Allan Stephens <allan.stephens@windriver.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* tipc: Expand link sequence gap field to 13 bitsAllan Stephens2008-06-041-4/+4
| | | | | | | | | | | | This patch increases the "sequence gap" field of the LINK_PROTOCOL message header from 8 bits to 13 bits (utilizing 5 previously unused 0 bits). This ensures that the field is big enough to indicate the loss of up to 8191 consecutive messages on the link, thereby accommodating the current worst-case scenario of 4000 lost messages. Signed-off-by: Allan Stephens <allan.stephens@windriver.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* tipc: Add missing spinlock in name table display codeAllan Stephens2008-06-041-1/+3
| | | | | | | | | | | This patch ensures that the display code that traverses the publication lists belonging to a name table entry take its associated spinlock, to protect against a possible change to one of its "head of list" pointers caused by a simultaneous name table lookup operation by another thread of control. Signed-off-by: Allan Stephens <allan.stephens@windriver.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* tipc: Prevent display of name table types with no publicationsAllan Stephens2008-06-041-0/+3
| | | | | | | | | This patch adds a check to prevent TIPC's name table display code from listing a name type entry if it exists only to hold subscription info, rather than published names. Signed-off-by: Allan Stephens <allan.stephens@windriver.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* tipc: Optimize message initialization routineAllan Stephens2008-06-047-18/+16
| | | | | | | | | | This patch eliminates the rarely-used "error code" argument when initializing a TIPC message header, since the default value of zero is the desired result in most cases; the few exceptional cases now set the error code explicitly. Signed-off-by: Allan Stephens <allan.stephens@windriver.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* tipc: Prevent access of non-existent field in short message headerAllan Stephens2008-06-041-1/+3
| | | | | | | | | | This patch eliminates a case where TIPC's link code could try reading a field that is not present in a short message header. (The random value obtained was not being used, but the read operation could result in an invalid memory access exception in extremely rare circumstances.) Signed-off-by: Allan Stephens <allan.stephens@windriver.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* tipc: Minor optimizations to received message processingAllan Stephens2008-06-043-25/+8
| | | | | | | | | | | | This patch enhances TIPC's handler for incoming messages in two ways: - the trivial, single-use routine for processing non-sequenced messages has been merged into the main handler - the interface that received a message is now identified without having to access and/or modify the associated sk_buff Signed-off-by: Allan Stephens <allan.stephens@windriver.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* tipc: Fix minor bugs in link session number handlingAllan Stephens2008-06-041-5/+12
| | | | | | | | | | | | | | | This patch introduces a new, out-of-range value to indicate that a link endpoint does not have an existing session established with its peer, eliminating the risk that the previously used "invalid session number" value (i.e. zero) might eventually be assigned as a valid session number and cause incorrect link behavior. The patch also introduces explicit bit masking when assigning a new link session number to ensure it does not exceed 16 bits. Signed-off-by: Allan Stephens <allan.stephens@windriver.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* tipc: Fix bugs in message error code display when debuggingAllan Stephens2008-06-041-3/+0
| | | | | | | | | | | | This patch corrects two problems in the display of error code information in TIPC messages when debugging: - no longer tries to display error code in NAME_DISTRIBUTOR messages, which don't have the error field - now displays error code in 24 byte data messages, which do have the error field Signed-off-by: Allan Stephens <allan.stephens@windriver.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* tipc: Standardize error checking on incoming messages via native APIAllan Stephens2008-06-041-16/+9
| | | | | | | | | This patch re-orders & re-groups the error checks performed on messages being delivered to native API ports, in order to clarify the similarities and differences required for the various message types. Signed-off-by: Allan Stephens <allan.stephens@windriver.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* tipc: Fix bug in connection setup via native APIAllan Stephens2008-06-041-6/+3
| | | | | | | | | | | This patch fixes a bug that prevented TIPC from receiving a connection setup request message on a native TIPC port. The revised connection setup logic ensures that validation of the source of a connection-based message is skipped if the port is not yet connected to a peer. Signed-off-by: Allan Stephens <allan.stephens@windriver.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* tipc: Fix initialization sequence problems when entering network modeAllan Stephens2008-05-215-9/+12
| | | | | | | | | | | | | | This patch ensures that TIPC's topology service and configuration service are shut down before switching into "network mode". This ensures that TIPC does not mistakenly try to send unnecessary "publication withdraw" messages to other nodes before it is fully initialized for sending off-node messages. Note that the node's current network address is now updated only after the two services are shut down; this ensures that any existing connections to the topology server are terminated correctly using the old address. Signed-off-by: Allan Stephens <allan.stephens@windriver.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* tipc: Update "previous node" indicators when node address changesAllan Stephens2008-05-211-0/+1
| | | | | | | | | | This patch ensures that the "previous node" field in any existing TIPC port message header templates is updated properly when a TIPC network address is assigned to the node. (Previously, only the "originating node" field was updated.) Signed-off-by: Allan Stephens <allan.stephens@windriver.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* tipc: Optimize null pointer check during neighbor discoveryAllan Stephens2008-05-211-3/+2
| | | | | | | | This patch optimizes TIPC neighbor discovery code to avoid testing for a null node pointer when the pointer is already known to be non-null. Signed-off-by: Allan Stephens <allan.stephens@windriver.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* tipc: Prevent node object duplication due to simultaneous discoveryAllan Stephens2008-05-211-0/+26
| | | | | | | | | This patch ensures that the simultaneous discovery of the same neighboring node by multiple interfaces does not cause TIPC to add the node into its internal data structures more than once. Signed-off-by: Allan Stephens <allan.stephens@windriver.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* tipc: Fix skb_under_panic when configuring TIPC without privilegesAllan Stephens2008-05-212-8/+14
| | | | | | | | | | | | | This patch prevents a TIPC configuration command requiring network administrator privileges from triggering an skbuff underrun if it is issued by a process lacking those privileges. The revised error handling code avoids the use of a potentially uninitialized global variable by transforming the unauthorized command into a new command, then following the standard command processing path to generate the required error message. Signed-off-by: Allan Stephens <allan.stephens@windriver.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* tipc: Cosmetic cleanup of topology service codeAllan Stephens2008-05-192-15/+13
| | | | | | | | | | | | | This patch contains a set of cosmetic changes to TIPC's network topology service subsystem, including: - updates to comments (including copyright dates) - re-ordering structure fields to group them more logically - removal of optional debugging code that is no longer required - minor changes to whitespace to conform to Linux coding conventions Signed-off-by: Allan Stephens <allan.stephens@windriver.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* tipc: Consolidate subscriber & subscriber port referencesAllan Stephens2008-05-193-90/+116
| | | | | | | | | | | | | | | This patch modifies TIPC's network topology service so that it only requires a single reference table entry per subscriber connection, rather than two. This is achieved by letting the reference to the server port communicating with the subscriber act as the reference to the subscriber object itself. (Since the subscriber cannot exist without its port, and vice versa, this dual role for the reference is perfectly natural.) This consolidation reduces the size of the reference table by 50% in the default configuration. Signed-off-by: Allan Stephens <allan.stephens@windriver.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* tipc: Fix bug in topology server byte swapping routineAllan Stephens2008-05-191-3/+1
| | | | | | | | | | | | This patch fixes TIPC's topology server so that it does byte swapping correctly when endianness conversion is required. (Note: This bug only impacted an application if it issues a subscription request to a topology server on another node, rather than the server on it's own node; since the topology server is normally not accessible by off-node applications, most TIPC applications were not impacted by the bug.) Signed-off-by: Allan Stephens <allan.stephens@windriver.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* tipc: Add support for customized subscription endiannessAllan Stephens2008-05-192-19/+18
| | | | | | | | | | This patch enables TIPC's topology server code to do customized endianness conversions on a per-subscription basis. (This capability is needed to support the upcoming consolidation of subscriber and subscription object references.) Signed-off-by: Allan Stephens <allan.stephens@windriver.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* tipc: Add support for customized subscription overlap handlingAllan Stephens2008-05-192-1/+11
| | | | | | | | | | This patch enables TIPC's topology server code to do customized overlap detection handling on a per-subscription basis. (This capability is needed to support the upcoming introduction of multi-cluster TIPC networks.) Signed-off-by: Allan Stephens <allan.stephens@windriver.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* Merge branch 'master' of ↵David S. Miller2008-05-151-6/+5
|\ | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6 Conflicts: drivers/net/wireless/iwlwifi/iwl-4965-rs.c drivers/net/wireless/rt2x00/rt61pci.c
| * tipc: Increase buffer header to support worst-case deviceAllan Stephens2008-05-081-6/+5
| | | | | | | | | | | | | | | | This patch increases the headroom TIPC reserves in each sk_buff to accommodate the largest possible link level device header. Signed-off-by: Allan Stephens <allan.stephens@windriver.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | tipc: Fix race condition when creating socket or native portAllan Stephens2008-05-124-13/+25
| | | | | | | | | | | | | | | | | | | | | | This patch eliminates the (very remote) chance of a crash resulting from a partially initialized socket or native port unexpectedly receiving a message. Now, during the creation of a socket or native port, the underlying generic port's lock is not released until all initialization required to handle incoming messages has been done. Signed-off-by: Allan Stephens <allan.stephens@windriver.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | tipc: Enhancements to name table initializationAllan Stephens2008-05-121-5/+2
| | | | | | | | | | | | | | | | | | This patch enhances the initialization of TIPC's name table by removing a pointless spinlock operation, and by using kcalloc() to detect requests for an oversized name table. Signed-off-by: Allan Stephens <allan.stephens@windriver.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | tipc: Update version number to TIPC 1.6.4Allan Stephens2008-05-051-1/+1
| | | | | | | | | | | | | | This patch updates TIPC's version number to 1.6.4. Signed-off-by: Allan Stephens <allan.stephens@windriver.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | tipc: Exclude debug-only print buffer code when not debuggingAllan Stephens2008-05-054-13/+37
| | | | | | | | | | | | | | | | | | This patch modifies TIPC to only exclude debug-related print buffer routines when debugging capabilities are not required. It also fixes up some related #defines that exceed 80 characters. Signed-off-by: Allan Stephens <allan.stephens@windriver.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | tipc: Cosmetic cleanup of system & debug output declarationsAllan Stephens2008-05-051-50/+67
| | | | | | | | | | | | | | | | | | | | | | | | This patch contains changes to make TIPC's system & debug message declarations more readable. Declarations have been regrouped and recommented to make it easier to understand what output is generated in both standard and debugging modes. In addition, oversize lines have been fixed to respect the 80 character upper bound used in the kernel. Signed-off-by: Allan Stephens <allan.stephens@windriver.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | [TIPC]: Cosmetic cleanup of print buffer codeAllan Stephens2008-05-052-9/+11
| | | | | | | | | | | | | | | | This patch contains changes to make TIPC's print buffer code conform more closely to Linux kernel coding guidelines. Signed-off-by: Allan Stephens <allan.stephens@windriver.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | tipc: Elimination of print buffer chainingAllan Stephens2008-05-053-94/+80
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch revamps TIPC's print buffer subsystem to eliminate support for arbitrary chains of print buffers, which were rarely needed and difficult to use safely. In its place, print buffers can now be configured to echo their output to the system console. This provides an equivalent for the only chaining currently utilized by TIPC, in a faster and more compact manner. Signed-off-by: Allan Stephens <allan.stephens@windriver.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | tipc: Fix null pointer dereference in debug codeAllan Stephens2008-05-051-3/+0
| | | | | | | | | | | | | | | | | | This patch eliminates an obsolete use of the DBG_OUTPUT print buffer which could lead to a null pointer crash in tipc_printf() if TIPC's debugging capabilities are configured. Signed-off-by: Allan Stephens <allan.stephens@windriver.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | tipc: Fix recursive spinlock invocation in print buffer codeAllan Stephens2008-05-051-5/+12
| | | | | | | | | | | | | | | | This patch fixes two routines that allow the global print buffer spinlock to be taken recursively. Signed-off-by: Allan Stephens <allan.stephens@windriver.com> Signed-off-by: David S. Miller <davem@davemloft.net>