aboutsummaryrefslogtreecommitdiffstats
path: root/net/tipc/link.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/tipc/link.c')
-rw-r--r--net/tipc/link.c35
1 files changed, 35 insertions, 0 deletions
diff --git a/net/tipc/link.c b/net/tipc/link.c
index 26cc033ee167..4ed650ce6e61 100644
--- a/net/tipc/link.c
+++ b/net/tipc/link.c
@@ -410,6 +410,11 @@ char *tipc_link_name(struct tipc_link *l)
410 return l->name; 410 return l->name;
411} 411}
412 412
413u32 tipc_link_state(struct tipc_link *l)
414{
415 return l->state;
416}
417
413/** 418/**
414 * tipc_link_create - create a new link 419 * tipc_link_create - create a new link
415 * @n: pointer to associated node 420 * @n: pointer to associated node
@@ -1385,6 +1390,36 @@ static void tipc_link_build_proto_msg(struct tipc_link *l, int mtyp, bool probe,
1385 __skb_queue_tail(xmitq, skb); 1390 __skb_queue_tail(xmitq, skb);
1386} 1391}
1387 1392
1393void tipc_link_create_dummy_tnl_msg(struct tipc_link *l,
1394 struct sk_buff_head *xmitq)
1395{
1396 u32 onode = tipc_own_addr(l->net);
1397 struct tipc_msg *hdr, *ihdr;
1398 struct sk_buff_head tnlq;
1399 struct sk_buff *skb;
1400 u32 dnode = l->addr;
1401
1402 skb_queue_head_init(&tnlq);
1403 skb = tipc_msg_create(TUNNEL_PROTOCOL, FAILOVER_MSG,
1404 INT_H_SIZE, BASIC_H_SIZE,
1405 dnode, onode, 0, 0, 0);
1406 if (!skb) {
1407 pr_warn("%sunable to create tunnel packet\n", link_co_err);
1408 return;
1409 }
1410
1411 hdr = buf_msg(skb);
1412 msg_set_msgcnt(hdr, 1);
1413 msg_set_bearer_id(hdr, l->peer_bearer_id);
1414
1415 ihdr = (struct tipc_msg *)msg_data(hdr);
1416 tipc_msg_init(onode, ihdr, TIPC_LOW_IMPORTANCE, TIPC_DIRECT_MSG,
1417 BASIC_H_SIZE, dnode);
1418 msg_set_errcode(ihdr, TIPC_ERR_NO_PORT);
1419 __skb_queue_tail(&tnlq, skb);
1420 tipc_link_xmit(l, &tnlq, xmitq);
1421}
1422
1388/* tipc_link_tnl_prepare(): prepare and return a list of tunnel packets 1423/* tipc_link_tnl_prepare(): prepare and return a list of tunnel packets
1389 * with contents of the link's transmit and backlog queues. 1424 * with contents of the link's transmit and backlog queues.
1390 */ 1425 */