Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 279088
b: refs/heads/master
c: 6c34921
h: refs/heads/master
v: v3
  • Loading branch information
Allan Stephens authored and Paul Gortmaker committed Dec 27, 2011
1 parent a947243 commit 0102d1c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 30 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: a31abe8daee5dd618aecb1484dbe9bf68c5c8a4a
refs/heads/master: 6c349210101352103d9055636845155bc801ae9b
37 changes: 8 additions & 29 deletions trunk/net/tipc/bearer.c
Original file line number Diff line number Diff line change
Expand Up @@ -106,48 +106,27 @@ int tipc_register_media(struct media *m_ptr)

write_lock_bh(&tipc_net_lock);

if (tipc_mode != TIPC_NET_MODE) {
warn("Media <%s> rejected, not in networked mode yet\n",
m_ptr->name);
if (!media_name_valid(m_ptr->name))
goto exit;
}
if (!media_name_valid(m_ptr->name)) {
warn("Media <%s> rejected, illegal name\n", m_ptr->name);
if (m_ptr->bcast_addr.type != htonl(m_ptr->type_id))
goto exit;
}
if (m_ptr->bcast_addr.type != htonl(m_ptr->type_id)) {
warn("Media <%s> rejected, illegal broadcast address\n",
m_ptr->name);
goto exit;
}
if ((m_ptr->priority < TIPC_MIN_LINK_PRI) ||
(m_ptr->priority > TIPC_MAX_LINK_PRI)) {
warn("Media <%s> rejected, illegal priority (%u)\n",
m_ptr->name, m_ptr->priority);
if (m_ptr->priority > TIPC_MAX_LINK_PRI)
goto exit;
}
if ((m_ptr->tolerance < TIPC_MIN_LINK_TOL) ||
(m_ptr->tolerance > TIPC_MAX_LINK_TOL)) {
warn("Media <%s> rejected, illegal tolerance (%u)\n",
m_ptr->name, m_ptr->tolerance);
(m_ptr->tolerance > TIPC_MAX_LINK_TOL))
goto exit;
}

if (media_count >= MAX_MEDIA) {
warn("Media <%s> rejected, media limit reached (%u)\n",
m_ptr->name, MAX_MEDIA);
if (media_count >= MAX_MEDIA)
goto exit;
}
if (media_find(m_ptr->name) || media_find_id(m_ptr->type_id)) {
warn("Media <%s> rejected, already registered\n", m_ptr->name);
if (media_find(m_ptr->name) || media_find_id(m_ptr->type_id))
goto exit;
}

media_list[media_count] = m_ptr;
media_count++;
res = 0;
exit:
write_unlock_bh(&tipc_net_lock);
if (res)
warn("Media <%s> registration error\n", m_ptr->name);
return res;
}

Expand Down

0 comments on commit 0102d1c

Please sign in to comment.