Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 290501
b: refs/heads/master
c: c422f1b
h: refs/heads/master
i:
  290499: 81a576e
v: v3
  • Loading branch information
Allan Stephens authored and Paul Gortmaker committed Feb 24, 2012
1 parent 294b8c1 commit f571567
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 28 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: c74a46110fd5f97bf9299e68e9ed0453bdacb181
refs/heads/master: c422f1bdc3d3f9f637b3d288a6601668e26111d6
2 changes: 1 addition & 1 deletion trunk/net/tipc/config.c
Original file line number Diff line number Diff line change
Expand Up @@ -481,7 +481,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;

Expand Down
24 changes: 1 addition & 23 deletions trunk/net/tipc/name_table.c
Original file line number Diff line number Diff line change
Expand Up @@ -114,10 +114,8 @@ struct name_table {
};

static struct name_table table;
static atomic_t rsv_publ_ok = ATOMIC_INIT(0);
DEFINE_RWLOCK(tipc_nametbl_lock);


static int hash(int x)
{
return x & (tipc_nametbl_size - 1);
Expand Down Expand Up @@ -665,22 +663,7 @@ int tipc_nametbl_mc_translate(u32 type, u32 lower, u32 upper, u32 limit,
return res;
}

/**
* tipc_nametbl_publish_rsv - publish port name using a reserved name type
*/

int tipc_nametbl_publish_rsv(u32 ref, unsigned int scope,
struct tipc_name_seq const *seq)
{
int res;

atomic_inc(&rsv_publ_ok);
res = tipc_publish(ref, scope, seq);
atomic_dec(&rsv_publ_ok);
return res;
}

/**
/*
* tipc_nametbl_publish - add name publication to network name tables
*/

Expand All @@ -694,11 +677,6 @@ struct publication *tipc_nametbl_publish(u32 type, u32 lower, u32 upper,
tipc_max_publications);
return NULL;
}
if ((type < TIPC_RESERVED_TYPES) && !atomic_read(&rsv_publ_ok)) {
warn("Publication failed, reserved name {%u,%u,%u}\n",
type, lower, upper);
return NULL;
}

write_lock_bh(&tipc_nametbl_lock);
table.local_publ_count++;
Expand Down
2 changes: 0 additions & 2 deletions trunk/net/tipc/name_table.h
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,6 @@ struct sk_buff *tipc_nametbl_get(const void *req_tlv_area, int req_tlv_space);
u32 tipc_nametbl_translate(u32 type, u32 instance, u32 *node);
int tipc_nametbl_mc_translate(u32 type, u32 lower, u32 upper, u32 limit,
struct tipc_port_list *dports);
int tipc_nametbl_publish_rsv(u32 ref, unsigned int scope,
struct tipc_name_seq const *seq);
struct publication *tipc_nametbl_publish(u32 type, u32 lower, u32 upper,
u32 scope, u32 port_ref, u32 key);
int tipc_nametbl_withdraw(u32 type, u32 lower, u32 ref, u32 key);
Expand Down
3 changes: 3 additions & 0 deletions trunk/net/tipc/socket.c
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,9 @@ static int bind(struct socket *sock, struct sockaddr *uaddr, int uaddr_len)
else if (addr->addrtype != TIPC_ADDR_NAMESEQ)
return -EAFNOSUPPORT;

if (addr->addr.nameseq.type < TIPC_RESERVED_TYPES)
return -EACCES;

return (addr->scope > 0) ?
tipc_publish(portref, addr->scope, &addr->addr.nameseq) :
tipc_withdraw(portref, -addr->scope, &addr->addr.nameseq);
Expand Down
2 changes: 1 addition & 1 deletion trunk/net/tipc/subscr.c
Original file line number Diff line number Diff line change
Expand Up @@ -552,7 +552,7 @@ int tipc_subscr_start(void)
if (res)
goto failed;

res = tipc_nametbl_publish_rsv(topsrv.setup_port, TIPC_NODE_SCOPE, &seq);
res = tipc_publish(topsrv.setup_port, TIPC_NODE_SCOPE, &seq);
if (res) {
tipc_deleteport(topsrv.setup_port);
topsrv.setup_port = 0;
Expand Down

0 comments on commit f571567

Please sign in to comment.