Commit 49384507 authored by Allan Stephens's avatar Allan Stephens Committed by David S. Miller

[TIPC]: Corrected potential misuse of tipc_media_addr structure.

Signed-off-by: default avatarAllan Stephens <allan.stephens@windriver.com>
Signed-off-by: default avatarPer Liden <per.liden@ericsson.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 2535ec50
...@@ -49,10 +49,18 @@ ...@@ -49,10 +49,18 @@
#define TIPC_MEDIA_TYPE_ETH 1 #define TIPC_MEDIA_TYPE_ETH 1
/*
* Destination address structure used by TIPC bearers when sending messages
*
* IMPORTANT: The fields of this structure MUST be stored using the specified
* byte order indicated below, as the structure is exchanged between nodes
* as part of a link setup process.
*/
struct tipc_media_addr { struct tipc_media_addr {
__u32 type; __u32 type; /* bearer type (network byte order) */
union { union {
__u8 eth_addr[6]; /* Ethernet bearer */ __u8 eth_addr[6]; /* 48 bit Ethernet addr (byte array) */
#if 0 #if 0
/* Prototypes for other possible bearer types */ /* Prototypes for other possible bearer types */
......
...@@ -254,7 +254,9 @@ int tipc_eth_media_start(void) ...@@ -254,7 +254,9 @@ int tipc_eth_media_start(void)
if (eth_started) if (eth_started)
return -EINVAL; return -EINVAL;
memset(&bcast_addr, 0xff, sizeof(bcast_addr)); bcast_addr.type = htonl(TIPC_MEDIA_TYPE_ETH);
memset(&bcast_addr.dev_addr, 0xff, ETH_ALEN);
memset(eth_bearers, 0, sizeof(eth_bearers)); memset(eth_bearers, 0, sizeof(eth_bearers));
res = tipc_register_media(TIPC_MEDIA_TYPE_ETH, "eth", res = tipc_register_media(TIPC_MEDIA_TYPE_ETH, "eth",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment