diff options
Diffstat (limited to 'net/tipc')
-rw-r--r-- | net/tipc/bearer.c | 8 | ||||
-rw-r--r-- | net/tipc/link.c | 3 | ||||
-rw-r--r-- | net/tipc/node.c | 24 | ||||
-rw-r--r-- | net/tipc/node.h | 1 |
4 files changed, 32 insertions, 4 deletions
diff --git a/net/tipc/bearer.c b/net/tipc/bearer.c index c8001471da6c..83d284feab1a 100644 --- a/net/tipc/bearer.c +++ b/net/tipc/bearer.c | |||
@@ -946,11 +946,11 @@ int tipc_nl_bearer_add(struct sk_buff *skb, struct genl_info *info) | |||
946 | 946 | ||
947 | int tipc_nl_bearer_set(struct sk_buff *skb, struct genl_info *info) | 947 | int tipc_nl_bearer_set(struct sk_buff *skb, struct genl_info *info) |
948 | { | 948 | { |
949 | int err; | ||
950 | char *name; | ||
951 | struct tipc_bearer *b; | 949 | struct tipc_bearer *b; |
952 | struct nlattr *attrs[TIPC_NLA_BEARER_MAX + 1]; | 950 | struct nlattr *attrs[TIPC_NLA_BEARER_MAX + 1]; |
953 | struct net *net = sock_net(skb->sk); | 951 | struct net *net = sock_net(skb->sk); |
952 | char *name; | ||
953 | int err; | ||
954 | 954 | ||
955 | if (!info->attrs[TIPC_NLA_BEARER]) | 955 | if (!info->attrs[TIPC_NLA_BEARER]) |
956 | return -EINVAL; | 956 | return -EINVAL; |
@@ -982,8 +982,10 @@ int tipc_nl_bearer_set(struct sk_buff *skb, struct genl_info *info) | |||
982 | return err; | 982 | return err; |
983 | } | 983 | } |
984 | 984 | ||
985 | if (props[TIPC_NLA_PROP_TOL]) | 985 | if (props[TIPC_NLA_PROP_TOL]) { |
986 | b->tolerance = nla_get_u32(props[TIPC_NLA_PROP_TOL]); | 986 | b->tolerance = nla_get_u32(props[TIPC_NLA_PROP_TOL]); |
987 | tipc_node_apply_tolerance(net, b); | ||
988 | } | ||
987 | if (props[TIPC_NLA_PROP_PRIO]) | 989 | if (props[TIPC_NLA_PROP_PRIO]) |
988 | b->priority = nla_get_u32(props[TIPC_NLA_PROP_PRIO]); | 990 | b->priority = nla_get_u32(props[TIPC_NLA_PROP_PRIO]); |
989 | if (props[TIPC_NLA_PROP_WIN]) | 991 | if (props[TIPC_NLA_PROP_WIN]) |
diff --git a/net/tipc/link.c b/net/tipc/link.c index 2d6b2aed30e0..3c230466804d 100644 --- a/net/tipc/link.c +++ b/net/tipc/link.c | |||
@@ -2126,7 +2126,8 @@ void tipc_link_set_tolerance(struct tipc_link *l, u32 tol, | |||
2126 | struct sk_buff_head *xmitq) | 2126 | struct sk_buff_head *xmitq) |
2127 | { | 2127 | { |
2128 | l->tolerance = tol; | 2128 | l->tolerance = tol; |
2129 | tipc_link_build_proto_msg(l, STATE_MSG, 0, 0, 0, tol, 0, xmitq); | 2129 | if (link_is_up(l)) |
2130 | tipc_link_build_proto_msg(l, STATE_MSG, 0, 0, 0, tol, 0, xmitq); | ||
2130 | } | 2131 | } |
2131 | 2132 | ||
2132 | void tipc_link_set_prio(struct tipc_link *l, u32 prio, | 2133 | void tipc_link_set_prio(struct tipc_link *l, u32 prio, |
diff --git a/net/tipc/node.c b/net/tipc/node.c index 9036d8756e73..389193d7cf67 100644 --- a/net/tipc/node.c +++ b/net/tipc/node.c | |||
@@ -1618,6 +1618,30 @@ discard: | |||
1618 | kfree_skb(skb); | 1618 | kfree_skb(skb); |
1619 | } | 1619 | } |
1620 | 1620 | ||
1621 | void tipc_node_apply_tolerance(struct net *net, struct tipc_bearer *b) | ||
1622 | { | ||
1623 | struct tipc_net *tn = tipc_net(net); | ||
1624 | int bearer_id = b->identity; | ||
1625 | struct sk_buff_head xmitq; | ||
1626 | struct tipc_link_entry *e; | ||
1627 | struct tipc_node *n; | ||
1628 | |||
1629 | __skb_queue_head_init(&xmitq); | ||
1630 | |||
1631 | rcu_read_lock(); | ||
1632 | |||
1633 | list_for_each_entry_rcu(n, &tn->node_list, list) { | ||
1634 | tipc_node_write_lock(n); | ||
1635 | e = &n->links[bearer_id]; | ||
1636 | if (e->link) | ||
1637 | tipc_link_set_tolerance(e->link, b->tolerance, &xmitq); | ||
1638 | tipc_node_write_unlock(n); | ||
1639 | tipc_bearer_xmit(net, bearer_id, &xmitq, &e->maddr); | ||
1640 | } | ||
1641 | |||
1642 | rcu_read_unlock(); | ||
1643 | } | ||
1644 | |||
1621 | int tipc_nl_peer_rm(struct sk_buff *skb, struct genl_info *info) | 1645 | int tipc_nl_peer_rm(struct sk_buff *skb, struct genl_info *info) |
1622 | { | 1646 | { |
1623 | struct net *net = sock_net(skb->sk); | 1647 | struct net *net = sock_net(skb->sk); |
diff --git a/net/tipc/node.h b/net/tipc/node.h index acd58d23a70e..4ce5e3a185c0 100644 --- a/net/tipc/node.h +++ b/net/tipc/node.h | |||
@@ -65,6 +65,7 @@ void tipc_node_check_dest(struct net *net, u32 onode, | |||
65 | struct tipc_media_addr *maddr, | 65 | struct tipc_media_addr *maddr, |
66 | bool *respond, bool *dupl_addr); | 66 | bool *respond, bool *dupl_addr); |
67 | void tipc_node_delete_links(struct net *net, int bearer_id); | 67 | void tipc_node_delete_links(struct net *net, int bearer_id); |
68 | void tipc_node_apply_tolerance(struct net *net, struct tipc_bearer *b); | ||
68 | int tipc_node_get_linkname(struct net *net, u32 bearer_id, u32 node, | 69 | int tipc_node_get_linkname(struct net *net, u32 bearer_id, u32 node, |
69 | char *linkname, size_t len); | 70 | char *linkname, size_t len); |
70 | int tipc_node_xmit(struct net *net, struct sk_buff_head *list, u32 dnode, | 71 | int tipc_node_xmit(struct net *net, struct sk_buff_head *list, u32 dnode, |