|
@@ -697,6 +697,9 @@ static int __tipc_nl_add_bearer(struct tipc_nl_msg *msg,
|
|
goto prop_msg_full;
|
|
goto prop_msg_full;
|
|
if (nla_put_u32(msg->skb, TIPC_NLA_PROP_WIN, bearer->window))
|
|
if (nla_put_u32(msg->skb, TIPC_NLA_PROP_WIN, bearer->window))
|
|
goto prop_msg_full;
|
|
goto prop_msg_full;
|
|
|
|
+ if (bearer->media->type_id == TIPC_MEDIA_TYPE_UDP)
|
|
|
|
+ if (nla_put_u32(msg->skb, TIPC_NLA_PROP_MTU, bearer->mtu))
|
|
|
|
+ goto prop_msg_full;
|
|
|
|
|
|
nla_nest_end(msg->skb, prop);
|
|
nla_nest_end(msg->skb, prop);
|
|
|
|
|
|
@@ -979,12 +982,23 @@ int __tipc_nl_bearer_set(struct sk_buff *skb, struct genl_info *info)
|
|
|
|
|
|
if (props[TIPC_NLA_PROP_TOL]) {
|
|
if (props[TIPC_NLA_PROP_TOL]) {
|
|
b->tolerance = nla_get_u32(props[TIPC_NLA_PROP_TOL]);
|
|
b->tolerance = nla_get_u32(props[TIPC_NLA_PROP_TOL]);
|
|
- tipc_node_apply_tolerance(net, b);
|
|
|
|
|
|
+ tipc_node_apply_property(net, b, TIPC_NLA_PROP_TOL);
|
|
}
|
|
}
|
|
if (props[TIPC_NLA_PROP_PRIO])
|
|
if (props[TIPC_NLA_PROP_PRIO])
|
|
b->priority = nla_get_u32(props[TIPC_NLA_PROP_PRIO]);
|
|
b->priority = nla_get_u32(props[TIPC_NLA_PROP_PRIO]);
|
|
if (props[TIPC_NLA_PROP_WIN])
|
|
if (props[TIPC_NLA_PROP_WIN])
|
|
b->window = nla_get_u32(props[TIPC_NLA_PROP_WIN]);
|
|
b->window = nla_get_u32(props[TIPC_NLA_PROP_WIN]);
|
|
|
|
+ if (props[TIPC_NLA_PROP_MTU]) {
|
|
|
|
+ if (b->media->type_id != TIPC_MEDIA_TYPE_UDP)
|
|
|
|
+ return -EINVAL;
|
|
|
|
+#ifdef CONFIG_TIPC_MEDIA_UDP
|
|
|
|
+ if (tipc_udp_mtu_bad(nla_get_u32
|
|
|
|
+ (props[TIPC_NLA_PROP_MTU])))
|
|
|
|
+ return -EINVAL;
|
|
|
|
+ b->mtu = nla_get_u32(props[TIPC_NLA_PROP_MTU]);
|
|
|
|
+ tipc_node_apply_property(net, b, TIPC_NLA_PROP_MTU);
|
|
|
|
+#endif
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
return 0;
|
|
return 0;
|