Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 721a57a0 authored by David S. Miller's avatar David S. Miller
Browse files

Merge branch 'tipc-next'



Erik Hugne says:

====================
tipc: bug fix and some improvements

Most important is a fix for a nullptr exception that would occur when
name table subscriptions fail. The remaining patches are performance
improvements and cosmetic changes.

v2: remove unnecessary whitespace in patch #2
====================

Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents 247f6d0f d76a436d
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -742,7 +742,7 @@ int tipc_nl_bearer_disable(struct sk_buff *skb, struct genl_info *info)
		return -EINVAL;
	}

	bearer_disable(net, bearer, false);
	bearer_disable(net, bearer, true);
	rtnl_unlock();

	return 0;
+3 −2
Original line number Diff line number Diff line
@@ -50,8 +50,9 @@
 * - the field's actual content and length is defined per media
 * - remaining unused bytes in the field are set to zero
 */
#define TIPC_MEDIA_ADDR_SIZE	32
#define TIPC_MEDIA_INFO_SIZE	32
#define TIPC_MEDIA_TYPE_OFFSET	3
#define TIPC_MEDIA_ADDR_OFFSET	4

/*
 * Identifiers of supported TIPC media types
@@ -76,7 +77,7 @@ struct tipc_node_map {
 * @broadcast: non-zero if address is a broadcast address
 */
struct tipc_media_addr {
	u8 value[TIPC_MEDIA_ADDR_SIZE];
	u8 value[TIPC_MEDIA_INFO_SIZE];
	u8 media_id;
	u8 broadcast;
};
+3 −5
Original line number Diff line number Diff line
@@ -37,8 +37,6 @@
#include "core.h"
#include "bearer.h"

#define ETH_ADDR_OFFSET  4  /* MAC addr position inside address field */

/* Convert Ethernet address (media address format) to string */
static int tipc_eth_addr2str(struct tipc_media_addr *addr,
			     char *strbuf, int bufsz)
@@ -53,9 +51,9 @@ static int tipc_eth_addr2str(struct tipc_media_addr *addr,
/* Convert from media address format to discovery message addr format */
static int tipc_eth_addr2msg(char *msg, struct tipc_media_addr *addr)
{
	memset(msg, 0, TIPC_MEDIA_ADDR_SIZE);
	memset(msg, 0, TIPC_MEDIA_INFO_SIZE);
	msg[TIPC_MEDIA_TYPE_OFFSET] = TIPC_MEDIA_TYPE_ETH;
	memcpy(msg + ETH_ADDR_OFFSET, addr->value, ETH_ALEN);
	memcpy(msg + TIPC_MEDIA_ADDR_OFFSET, addr->value, ETH_ALEN);
	return 0;
}

@@ -79,7 +77,7 @@ static int tipc_eth_msg2addr(struct tipc_bearer *b,
			     char *msg)
{
	/* Skip past preamble: */
	msg += ETH_ADDR_OFFSET;
	msg += TIPC_MEDIA_ADDR_OFFSET;
	return tipc_eth_raw2addr(b, addr, msg);
}

+1 −1
Original line number Diff line number Diff line
@@ -57,7 +57,7 @@ static int tipc_ib_addr2str(struct tipc_media_addr *a, char *str_buf,
/* Convert from media address format to discovery message addr format */
static int tipc_ib_addr2msg(char *msg, struct tipc_media_addr *addr)
{
	memset(msg, 0, TIPC_MEDIA_ADDR_SIZE);
	memset(msg, 0, TIPC_MEDIA_INFO_SIZE);
	memcpy(msg, addr->value, INFINIBAND_ALEN);
	return 0;
}
+2 −2
Original line number Diff line number Diff line
@@ -76,7 +76,7 @@ struct plist;

#define MAX_MSG_SIZE (MAX_H_SIZE + TIPC_MAX_USER_MSG_SIZE)

#define TIPC_MEDIA_ADDR_OFFSET	5
#define TIPC_MEDIA_INFO_OFFSET	5

/**
 * TIPC message buffer code
@@ -688,7 +688,7 @@ static inline void msg_set_redundant_link(struct tipc_msg *m, u32 r)

static inline char *msg_media_addr(struct tipc_msg *m)
{
	return (char *)&m->hdr[TIPC_MEDIA_ADDR_OFFSET];
	return (char *)&m->hdr[TIPC_MEDIA_INFO_OFFSET];
}

/*
Loading