summaryrefslogtreecommitdiffstats
path: root/net/tipc/node.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/tipc/node.c')
-rw-r--r--net/tipc/node.c33
1 files changed, 30 insertions, 3 deletions
diff --git a/net/tipc/node.c b/net/tipc/node.c
index f29549de9245..6a44eb812baf 100644
--- a/net/tipc/node.c
+++ b/net/tipc/node.c
@@ -195,6 +195,27 @@ int tipc_node_get_mtu(struct net *net, u32 addr, u32 sel)
195 return mtu; 195 return mtu;
196} 196}
197 197
198bool tipc_node_get_id(struct net *net, u32 addr, u8 *id)
199{
200 u8 *own_id = tipc_own_id(net);
201 struct tipc_node *n;
202
203 if (!own_id)
204 return true;
205
206 if (addr == tipc_own_addr(net)) {
207 memcpy(id, own_id, TIPC_NODEID_LEN);
208 return true;
209 }
210 n = tipc_node_find(net, addr);
211 if (!n)
212 return false;
213
214 memcpy(id, &n->peer_id, TIPC_NODEID_LEN);
215 tipc_node_put(n);
216 return true;
217}
218
198u16 tipc_node_get_capabilities(struct net *net, u32 addr) 219u16 tipc_node_get_capabilities(struct net *net, u32 addr)
199{ 220{
200 struct tipc_node *n; 221 struct tipc_node *n;
@@ -1681,7 +1702,8 @@ discard:
1681 kfree_skb(skb); 1702 kfree_skb(skb);
1682} 1703}
1683 1704
1684void tipc_node_apply_tolerance(struct net *net, struct tipc_bearer *b) 1705void tipc_node_apply_property(struct net *net, struct tipc_bearer *b,
1706 int prop)
1685{ 1707{
1686 struct tipc_net *tn = tipc_net(net); 1708 struct tipc_net *tn = tipc_net(net);
1687 int bearer_id = b->identity; 1709 int bearer_id = b->identity;
@@ -1696,8 +1718,13 @@ void tipc_node_apply_tolerance(struct net *net, struct tipc_bearer *b)
1696 list_for_each_entry_rcu(n, &tn->node_list, list) { 1718 list_for_each_entry_rcu(n, &tn->node_list, list) {
1697 tipc_node_write_lock(n); 1719 tipc_node_write_lock(n);
1698 e = &n->links[bearer_id]; 1720 e = &n->links[bearer_id];
1699 if (e->link) 1721 if (e->link) {
1700 tipc_link_set_tolerance(e->link, b->tolerance, &xmitq); 1722 if (prop == TIPC_NLA_PROP_TOL)
1723 tipc_link_set_tolerance(e->link, b->tolerance,
1724 &xmitq);
1725 else if (prop == TIPC_NLA_PROP_MTU)
1726 tipc_link_set_mtu(e->link, b->mtu);
1727 }
1701 tipc_node_write_unlock(n); 1728 tipc_node_write_unlock(n);
1702 tipc_bearer_xmit(net, bearer_id, &xmitq, &e->maddr); 1729 tipc_bearer_xmit(net, bearer_id, &xmitq, &e->maddr);
1703 } 1730 }