diff options
author | Jon Paul Maloy <jon.maloy@ericsson.com> | 2014-05-14 05:39:13 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-05-14 15:19:48 -0400 |
commit | 38504c28a201a80d12a6a0f821fecb331cb1f223 (patch) | |
tree | 001139319f80f9d00cfa510638f61a1ec1725459 /net/tipc/discover.c | |
parent | 37e22164a8a3c39bdad45aa463b1e69a1fdf4110 (diff) |
tipc: improve and extend media address conversion functions
TIPC currently handles two media specific addresses: Ethernet MAC
addresses and InfiniBand addresses. Those are kept in three different
formats:
1) A "raw" format as obtained from the device. This format is known
only by the media specific adapter code in eth_media.c and
ib_media.c.
2) A "generic" internal format, in the form of struct tipc_media_addr,
which can be referenced and passed around by the generic media-
unaware code.
3) A serialized version of the latter, to be conveyed in neighbor
discovery messages.
Conversion between the three formats can only be done by the media
specific code, so we have function pointers for this purpose in
struct tipc_media. Here, the media adapters can install their own
conversion functions at startup.
We now introduce a new such function, 'raw2addr()', whose purpose
is to convert from format 1 to format 2 above. We also try to as far
as possible uniform commenting, variable names and usage of these
functions, with the purpose of making them more comprehensible.
We can now also remove the function tipc_l2_media_addr_set(), whose
job is done better by the new function.
Finally, we expand the field for serialized addresses (format 3)
in discovery messages from 20 to 32 bytes. This is permitted
according to the spec, and reduces the risk of problems when we
add new media in the future.
Signed-off-by: Jon Maloy <jon.maloy@ericsson.com>
Reviewed-by: Ying Xue <ying.xue@windriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/tipc/discover.c')
-rw-r--r-- | net/tipc/discover.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/tipc/discover.c b/net/tipc/discover.c index bd35c4a0746f..b15cbedfea13 100644 --- a/net/tipc/discover.c +++ b/net/tipc/discover.c | |||
@@ -83,7 +83,7 @@ static void tipc_disc_init_msg(struct sk_buff *buf, u32 type, | |||
83 | msg_set_node_sig(msg, tipc_random); | 83 | msg_set_node_sig(msg, tipc_random); |
84 | msg_set_dest_domain(msg, dest_domain); | 84 | msg_set_dest_domain(msg, dest_domain); |
85 | msg_set_bc_netid(msg, tipc_net_id); | 85 | msg_set_bc_netid(msg, tipc_net_id); |
86 | b_ptr->media->addr2msg(&b_ptr->addr, msg_media_addr(msg)); | 86 | b_ptr->media->addr2msg(msg_media_addr(msg), &b_ptr->addr); |
87 | } | 87 | } |
88 | 88 | ||
89 | /** | 89 | /** |