struct sk_buff *buf;
buf = bcl->first_out;
- while (buf && less_eq(buf_seqno(buf), after)) {
+ while (buf && less_eq(buf_seqno(buf), after))
buf = buf->next;
- }
tipc_link_retransmit(bcl, buf, mod(to - after));
}
/* Skip over packets that node has previously acknowledged */
crs = bcl->first_out;
- while (crs && less_eq(buf_seqno(crs), n_ptr->bclink.acked)) {
+ while (crs && less_eq(buf_seqno(crs), n_ptr->bclink.acked))
crs = crs->next;
- }
/* Update packets that node is now acknowledging */
unchar *addr = (unchar *)&a->dev_addr;
tipc_printf(pb, "UNKNOWN(%u)", media_type);
- for (i = 0; i < (sizeof(*a) - sizeof(a->type)); i++) {
+ for (i = 0; i < (sizeof(*a) - sizeof(a->type)); i++)
tipc_printf(pb, "-%02x", addr[i]);
- }
}
}
return; /* Not yet. */
if (link_blocked(l_ptr)) {
- if (event == TIMEOUT_EVT) {
+ if (event == TIMEOUT_EVT)
link_set_timer(l_ptr, cont_intv);
- }
return; /* Changeover going on */
}
if (n_ptr) {
tipc_node_lock(n_ptr);
l_ptr = n_ptr->active_links[selector & 1];
- if (l_ptr) {
+ if (l_ptr)
res = tipc_link_send_buf(l_ptr, buf);
- } else {
+ else
buf_discard(buf);
- }
tipc_node_unlock(n_ptr);
} else {
buf_discard(buf);
/* Ensure message data is a single contiguous unit */
- if (unlikely(buf_linearize(buf))) {
+ if (unlikely(buf_linearize(buf)))
goto cont;
- }
/* Handle arrival of a non-unicast link message */
*head = buf;
return 1;
}
- if (seq_no == msg_seqno(msg)) {
+ if (seq_no == msg_seqno(msg))
break;
- }
prev = crs;
crs = crs->next;
} while (crs);
msg_set_max_pkt(msg, l_ptr->max_pkt_target);
}
- if (tipc_node_has_redundant_links(l_ptr->owner)) {
+ if (tipc_node_has_redundant_links(l_ptr->owner))
msg_set_redundant_link(msg);
- } else {
+ else
msg_clear_redundant_link(msg);
- }
msg_set_linkprio(msg, l_ptr->priority);
/* Ensure sequence number will not fit : */
l_ptr->peer_bearer_id = msg_bearer_id(msg);
/* Synchronize broadcast sequence numbers */
- if (!tipc_node_has_redundant_links(l_ptr->owner)) {
+ if (!tipc_node_has_redundant_links(l_ptr->owner))
l_ptr->owner->bclink.last_in = mod(msg_last_bcast(msg));
- }
break;
case STATE_MSG:
max_pkt_ack = 0;
if (msg_probe(msg)) {
l_ptr->stats.recv_probes++;
- if (msg_size(msg) > sizeof(l_ptr->proto_msg)) {
+ if (msg_size(msg) > sizeof(l_ptr->proto_msg))
max_pkt_ack = msg_size(msg);
- }
}
/* Protocol message before retransmits, reduce loss risk */
tipc_printf(buf, "UNKNOWN ERROR(%x):",
msg_errcode(msg));
}
- default:{}
+ default:
+ break;
}
tipc_printf(buf, "HZ(%u):", msg_hdr_sz(msg));
if (msg_non_seq(msg))
tipc_printf(buf, "NOSEQ:");
- else {
+ else
tipc_printf(buf, "ACK(%u):", msg_ack(msg));
- }
tipc_printf(buf, "BACK(%u):", msg_bcast_ack(msg));
tipc_printf(buf, "PRND(%x)", msg_prevnode(msg));
if (msg_user(msg) == NAME_DISTRIBUTOR) {
tipc_printf(buf, ":ONOD(%x):", msg_orignode(msg));
tipc_printf(buf, ":DNOD(%x):", msg_destnode(msg));
- if (msg_routed(msg)) {
+ if (msg_routed(msg))
tipc_printf(buf, ":CSEQN(%u)", msg_transp_seqno(msg));
- }
}
if (msg_user(msg) == LINK_CONFIG) {
tipc_printf(buf, "TO(%u):", msg_bcgap_to(msg));
}
tipc_printf(buf, "\n");
- if ((usr == CHANGEOVER_PROTOCOL) && (msg_msgcnt(msg))) {
+ if ((usr == CHANGEOVER_PROTOCOL) && (msg_msgcnt(msg)))
tipc_msg_dbg(buf, msg_get_wrapped(msg), " /");
- }
- if ((usr == MSG_FRAGMENTER) && (msg_type(msg) == FIRST_FRAGMENT)) {
+ if ((usr == MSG_FRAGMENTER) && (msg_type(msg) == FIRST_FRAGMENT))
tipc_msg_dbg(buf, msg_get_wrapped(msg), " /");
- }
}
#endif
table.local_publ_count++;
publ = tipc_nametbl_insert_publ(type, lower, upper, scope,
tipc_own_addr, port_ref, key);
- if (publ && (scope != TIPC_NODE_SCOPE)) {
+ if (publ && (scope != TIPC_NODE_SCOPE))
tipc_named_publish(publ);
- }
write_unlock_bh(&tipc_nametbl_lock);
return publ;
}
write_lock_bh(&tipc_nametbl_lock);
seq = nametbl_find_seq(type);
- if (!seq) {
+ if (!seq)
seq = tipc_nameseq_create(type, &table.types[hash(type)]);
- }
if (seq) {
spin_lock_bh(&seq->lock);
tipc_nameseq_subscribe(seq, s);
}
}
res = tipc_bclink_send_msg(buf);
- if ((res < 0) && (dports.count != 0)) {
+ if ((res < 0) && (dports.count != 0))
buf_discard(ibuf);
- }
} else {
ibuf = buf;
}
warn("Unable to deliver multicast message(s)\n");
goto exit;
}
- if ((index == 0) && (cnt != 0)) {
+ if ((index == 0) && (cnt != 0))
item = item->next;
- }
msg_set_destport(buf_msg(b), item->ports[index]);
tipc_port_recv_msg(b);
}
m->msg_iov);
}
if (likely(res != -ELINKCONG)) {
- if (needs_conn && (res >= 0)) {
+ if (needs_conn && (res >= 0))
sock->state = SS_CONNECTING;
- }
break;
}
if (m->msg_flags & MSG_DONTWAIT) {
}
res = tipc_send(tport->ref, m->msg_iovlen, m->msg_iov);
- if (likely(res != -ELINKCONG)) {
+ if (likely(res != -ELINKCONG))
break;
- }
if (m->msg_flags & MSG_DONTWAIT) {
res = -EWOULDBLOCK;
break;
m.msg_name = dest;
m.msg_namelen = destlen;
res = send_msg(NULL, sock, &m, 0);
- if (res < 0) {
+ if (res < 0)
goto exit;
- }
/* Wait until an 'ACK' or 'RST' arrives, or a timeout occurs */
advance_rx_queue(sk);
}
} else {
- if (sock->state == SS_CONNECTED) {
+ if (sock->state == SS_CONNECTED)
res = -EISCONN;
- } else {
+ else
res = -ECONNREFUSED;
- }
}
} else {
if (res == 0)