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

Commit 06b8db9c authored by David S. Miller's avatar David S. Miller
Browse files
parents 9100eb01 9bbbc59d
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
@@ -256,7 +256,7 @@ void tipc_bclink_acknowledge(struct tipc_node *n_ptr, u32 acked)
		if (bcbuf_acks(crs) == 0) {
			bcl->first_out = next;
			bcl->out_queue_size--;
			buf_discard(crs);
			kfree_skb(crs);
			released = 1;
		}
		crs = next;
@@ -330,7 +330,7 @@ void tipc_bclink_update_link_state(struct tipc_node *n_ptr, u32 last_sent)
		tipc_bearer_send(&bcbearer->bearer, buf, NULL);
		bcl->stats.sent_nacks++;
		spin_unlock_bh(&bc_lock);
		buf_discard(buf);
		kfree_skb(buf);

		n_ptr->bclink.oos_state++;
	}
@@ -374,7 +374,7 @@ int tipc_bclink_send_msg(struct sk_buff *buf)

	if (!bclink->bcast_nodes.count) {
		res = msg_data_sz(buf_msg(buf));
		buf_discard(buf);
		kfree_skb(buf);
		goto exit;
	}

@@ -480,7 +480,7 @@ void tipc_bclink_recv_pkt(struct sk_buff *buf)
			if (likely(msg_mcast(msg)))
				tipc_port_recv_mcast(buf, NULL);
			else
				buf_discard(buf);
				kfree_skb(buf);
		} else if (msg_user(msg) == MSG_BUNDLER) {
			spin_lock_bh(&bc_lock);
			bclink_accept_pkt(node, seqno);
@@ -513,7 +513,7 @@ void tipc_bclink_recv_pkt(struct sk_buff *buf)
			bclink_accept_pkt(node, seqno);
			spin_unlock_bh(&bc_lock);
			tipc_node_unlock(node);
			buf_discard(buf);
			kfree_skb(buf);
		}
		buf = NULL;

@@ -569,7 +569,7 @@ void tipc_bclink_recv_pkt(struct sk_buff *buf)
unlock:
	tipc_node_unlock(node);
exit:
	buf_discard(buf);
	kfree_skb(buf);
}

u32 tipc_bclink_acks_missing(struct tipc_node *n_ptr)
+2 −3
Original line number Diff line number Diff line
@@ -435,7 +435,7 @@ int tipc_enable_bearer(const char *name, u32 disc_domain, u32 priority)
	u32 i;
	int res = -EINVAL;

	if (tipc_mode != TIPC_NET_MODE) {
	if (!tipc_own_addr) {
		warn("Bearer <%s> rejected, not supported in standalone mode\n",
		     name);
		return -ENOPROTOOPT;
@@ -456,8 +456,7 @@ int tipc_enable_bearer(const char *name, u32 disc_domain, u32 priority)
		warn("Bearer <%s> rejected, illegal discovery domain\n", name);
		return -EINVAL;
	}
	if ((priority < TIPC_MIN_LINK_PRI ||
	     priority > TIPC_MAX_LINK_PRI) &&
	if ((priority > TIPC_MAX_LINK_PRI) &&
	    (priority != TIPC_MEDIA_LINK_PRI)) {
		warn("Bearer <%s> rejected, illegal priority\n", name);
		return -EINVAL;
+9 −12
Original line number Diff line number Diff line
@@ -179,7 +179,7 @@ static struct sk_buff *cfg_set_own_addr(void)
	if (!tipc_addr_node_valid(addr))
		return tipc_cfg_reply_error_string(TIPC_CFG_INVALID_VALUE
						   " (node address)");
	if (tipc_mode == TIPC_NET_MODE)
	if (tipc_own_addr)
		return tipc_cfg_reply_error_string(TIPC_CFG_NOT_SUPPORTED
						   " (cannot change node address once assigned)");

@@ -218,7 +218,7 @@ static struct sk_buff *cfg_set_max_publications(void)
		return tipc_cfg_reply_error_string(TIPC_CFG_TLV_ERROR);

	value = ntohl(*(__be32 *)TLV_DATA(req_tlv_area));
	if (value != delimit(value, 1, 65535))
	if (value < 1 || value > 65535)
		return tipc_cfg_reply_error_string(TIPC_CFG_INVALID_VALUE
						   " (max publications must be 1-65535)");
	tipc_max_publications = value;
@@ -233,7 +233,7 @@ static struct sk_buff *cfg_set_max_subscriptions(void)
		return tipc_cfg_reply_error_string(TIPC_CFG_TLV_ERROR);

	value = ntohl(*(__be32 *)TLV_DATA(req_tlv_area));
	if (value != delimit(value, 1, 65535))
	if (value < 1 || value > 65535)
		return tipc_cfg_reply_error_string(TIPC_CFG_INVALID_VALUE
						   " (max subscriptions must be 1-65535");
	tipc_max_subscriptions = value;
@@ -249,14 +249,11 @@ static struct sk_buff *cfg_set_max_ports(void)
	value = ntohl(*(__be32 *)TLV_DATA(req_tlv_area));
	if (value == tipc_max_ports)
		return tipc_cfg_reply_none();
	if (value != delimit(value, 127, 65535))
	if (value < 127 || value > 65535)
		return tipc_cfg_reply_error_string(TIPC_CFG_INVALID_VALUE
						   " (max ports must be 127-65535)");
	if (tipc_mode != TIPC_NOT_RUNNING)
	return tipc_cfg_reply_error_string(TIPC_CFG_NOT_SUPPORTED
		" (cannot change max ports while TIPC is active)");
	tipc_max_ports = value;
	return tipc_cfg_reply_none();
}

static struct sk_buff *cfg_set_netid(void)
@@ -268,10 +265,10 @@ static struct sk_buff *cfg_set_netid(void)
	value = ntohl(*(__be32 *)TLV_DATA(req_tlv_area));
	if (value == tipc_net_id)
		return tipc_cfg_reply_none();
	if (value != delimit(value, 1, 9999))
	if (value < 1 || value > 9999)
		return tipc_cfg_reply_error_string(TIPC_CFG_INVALID_VALUE
						   " (network id must be 1-9999)");
	if (tipc_mode == TIPC_NET_MODE)
	if (tipc_own_addr)
		return tipc_cfg_reply_error_string(TIPC_CFG_NOT_SUPPORTED
			" (cannot change network id once TIPC has joined a network)");
	tipc_net_id = value;
@@ -481,7 +478,7 @@ int tipc_cfg_init(void)

	seq.type = TIPC_CFG_SRV;
	seq.lower = seq.upper = tipc_own_addr;
	res = tipc_nametbl_publish_rsv(config_port_ref, TIPC_ZONE_SCOPE, &seq);
	res = tipc_publish(config_port_ref, TIPC_ZONE_SCOPE, &seq);
	if (res)
		goto failed;

+0 −10
Original line number Diff line number Diff line
@@ -53,7 +53,6 @@

/* global variables used by multiple sub-systems within TIPC */

int tipc_mode = TIPC_NOT_RUNNING;
int tipc_random;

const char tipc_alphabet[] =
@@ -125,11 +124,6 @@ int tipc_core_start_net(unsigned long addr)

static void tipc_core_stop(void)
{
	if (tipc_mode != TIPC_NODE_MODE)
		return;

	tipc_mode = TIPC_NOT_RUNNING;

	tipc_netlink_stop();
	tipc_handler_stop();
	tipc_cfg_stop();
@@ -148,11 +142,7 @@ static int tipc_core_start(void)
{
	int res;

	if (tipc_mode != TIPC_NOT_RUNNING)
		return -ENOPROTOOPT;

	get_random_bytes(&tipc_random, sizeof(tipc_random));
	tipc_mode = TIPC_NODE_MODE;

	res = tipc_handler_start();
	if (!res)
+0 −42
Original line number Diff line number Diff line
@@ -129,13 +129,6 @@ void tipc_msg_dbg(struct print_buf *, struct tipc_msg *, const char *);

#define ELINKCONG EAGAIN	/* link congestion <=> resource unavailable */

/*
 * TIPC operating mode routines
 */
#define TIPC_NOT_RUNNING  0
#define TIPC_NODE_MODE    1
#define TIPC_NET_MODE     2

/*
 * Global configuration variables
 */
@@ -151,7 +144,6 @@ extern int tipc_remote_management;
 * Other global variables
 */

extern int tipc_mode;
extern int tipc_random;
extern const char tipc_alphabet[];

@@ -168,16 +160,6 @@ extern void tipc_netlink_stop(void);
extern int  tipc_socket_init(void);
extern void tipc_socket_stop(void);

static inline int delimit(int val, int min, int max)
{
	if (val > max)
		return max;
	if (val < min)
		return min;
	return val;
}


/*
 * TIPC timer and signal code
 */
@@ -279,28 +261,4 @@ static inline struct tipc_msg *buf_msg(struct sk_buff *skb)

extern struct sk_buff *tipc_buf_acquire(u32 size);

/**
 * buf_discard - frees a TIPC message buffer
 * @skb: message buffer
 *
 * Frees a message buffer.  If passed NULL, just returns.
 */

static inline void buf_discard(struct sk_buff *skb)
{
	kfree_skb(skb);
}

/**
 * buf_linearize - convert a TIPC message buffer into a single contiguous piece
 * @skb: message buffer
 *
 * Returns 0 on success.
 */

static inline int buf_linearize(struct sk_buff *skb)
{
	return skb_linearize(skb);
}

#endif
Loading