]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
[TIPC]: Corrected potential misuse of tipc_media_addr structure.
authorAllan Stephens <allan.stephens@windriver.com>
Mon, 26 Jun 2006 06:38:29 +0000 (23:38 -0700)
committerDavid S. Miller <davem@davemloft.net>
Mon, 26 Jun 2006 06:38:29 +0000 (23:38 -0700)
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
Signed-off-by: Per Liden <per.liden@ericsson.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/net/tipc/tipc_bearer.h
net/tipc/eth_media.c

index 098607cd4b78d7998792aa52e0b0a72b2986daff..e07136d74c2f7805d363e9529a4ef10a9b62caa2 100644 (file)
 
 #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 {
-       __u32  type;
+       __u32  type;                    /* bearer type (network byte order) */
        union {
-               __u8   eth_addr[6];     /* Ethernet bearer */ 
+               __u8   eth_addr[6];     /* 48 bit Ethernet addr (byte array) */ 
 #if 0
                /* Prototypes for other possible bearer types */
 
index b64661904e0d9099857c5eabce2d870905b6df9a..3ecb1006a42d52edf1753f4248b3fb72d585760d 100644 (file)
@@ -254,7 +254,9 @@ int tipc_eth_media_start(void)
        if (eth_started)
                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));
 
        res = tipc_register_media(TIPC_MEDIA_TYPE_ETH, "eth",