node.c (4cbf8ac2fe5a0846508fe02b95a5de1a90fa73f4) | node.c (fc1b6d6de2208774efd2a20bf0daddb02d18b1e0) |
---|---|
1/* 2 * net/tipc/node.c: TIPC node management routines 3 * 4 * Copyright (c) 2000-2006, 2012-2016, Ericsson AB 5 * Copyright (c) 2005-2006, 2010-2014, Wind River Systems 6 * All rights reserved. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 30 unchanged lines hidden (view full) --- 39#include "node.h" 40#include "name_distr.h" 41#include "socket.h" 42#include "bcast.h" 43#include "monitor.h" 44#include "discover.h" 45#include "netlink.h" 46#include "trace.h" | 1/* 2 * net/tipc/node.c: TIPC node management routines 3 * 4 * Copyright (c) 2000-2006, 2012-2016, Ericsson AB 5 * Copyright (c) 2005-2006, 2010-2014, Wind River Systems 6 * All rights reserved. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 30 unchanged lines hidden (view full) --- 39#include "node.h" 40#include "name_distr.h" 41#include "socket.h" 42#include "bcast.h" 43#include "monitor.h" 44#include "discover.h" 45#include "netlink.h" 46#include "trace.h" |
47#include "crypto.h" |
|
47 48#define INVALID_NODE_SIG 0x10000 49#define NODE_CLEANUP_AFTER 300000 50 51/* Flags used to take different actions according to flag type 52 * TIPC_NOTIFY_NODE_DOWN: notify node is down 53 * TIPC_NOTIFY_NODE_UP: notify node is up 54 * TIPC_DISTRIBUTE_NAME: publish or withdraw link state name type --- 40 unchanged lines hidden (view full) --- 95 * @working_links: number of working links to node (both active and standby) 96 * @link_cnt: number of links to node 97 * @capabilities: bitmap, indicating peer node's functional capabilities 98 * @signature: node instance identifier 99 * @link_id: local and remote bearer ids of changing link, if any 100 * @publ_list: list of publications 101 * @rcu: rcu struct for tipc_node 102 * @delete_at: indicates the time for deleting a down node | 48 49#define INVALID_NODE_SIG 0x10000 50#define NODE_CLEANUP_AFTER 300000 51 52/* Flags used to take different actions according to flag type 53 * TIPC_NOTIFY_NODE_DOWN: notify node is down 54 * TIPC_NOTIFY_NODE_UP: notify node is up 55 * TIPC_DISTRIBUTE_NAME: publish or withdraw link state name type --- 40 unchanged lines hidden (view full) --- 96 * @working_links: number of working links to node (both active and standby) 97 * @link_cnt: number of links to node 98 * @capabilities: bitmap, indicating peer node's functional capabilities 99 * @signature: node instance identifier 100 * @link_id: local and remote bearer ids of changing link, if any 101 * @publ_list: list of publications 102 * @rcu: rcu struct for tipc_node 103 * @delete_at: indicates the time for deleting a down node |
104 * @crypto_rx: RX crypto handler |
|
103 */ 104struct tipc_node { 105 u32 addr; 106 struct kref kref; 107 rwlock_t lock; 108 struct net *net; 109 struct hlist_node hash; 110 int active_links[2]; --- 15 unchanged lines hidden (view full) --- 126 struct list_head publ_list; 127 struct list_head conn_sks; 128 unsigned long keepalive_intv; 129 struct timer_list timer; 130 struct rcu_head rcu; 131 unsigned long delete_at; 132 struct net *peer_net; 133 u32 peer_hash_mix; | 105 */ 106struct tipc_node { 107 u32 addr; 108 struct kref kref; 109 rwlock_t lock; 110 struct net *net; 111 struct hlist_node hash; 112 int active_links[2]; --- 15 unchanged lines hidden (view full) --- 128 struct list_head publ_list; 129 struct list_head conn_sks; 130 unsigned long keepalive_intv; 131 struct timer_list timer; 132 struct rcu_head rcu; 133 unsigned long delete_at; 134 struct net *peer_net; 135 u32 peer_hash_mix; |
136#ifdef CONFIG_TIPC_CRYPTO 137 struct tipc_crypto *crypto_rx; 138#endif |
|
134}; 135 136/* Node FSM states and events: 137 */ 138enum { 139 SELF_DOWN_PEER_DOWN = 0xdd, 140 SELF_UP_PEER_UP = 0xaa, 141 SELF_DOWN_PEER_LEAVING = 0xd1, --- 21 unchanged lines hidden (view full) --- 163static void tipc_node_link_down(struct tipc_node *n, int bearer_id, 164 bool delete); 165static void node_lost_contact(struct tipc_node *n, struct sk_buff_head *inputq); 166static void tipc_node_delete(struct tipc_node *node); 167static void tipc_node_timeout(struct timer_list *t); 168static void tipc_node_fsm_evt(struct tipc_node *n, int evt); 169static struct tipc_node *tipc_node_find(struct net *net, u32 addr); 170static struct tipc_node *tipc_node_find_by_id(struct net *net, u8 *id); | 139}; 140 141/* Node FSM states and events: 142 */ 143enum { 144 SELF_DOWN_PEER_DOWN = 0xdd, 145 SELF_UP_PEER_UP = 0xaa, 146 SELF_DOWN_PEER_LEAVING = 0xd1, --- 21 unchanged lines hidden (view full) --- 168static void tipc_node_link_down(struct tipc_node *n, int bearer_id, 169 bool delete); 170static void node_lost_contact(struct tipc_node *n, struct sk_buff_head *inputq); 171static void tipc_node_delete(struct tipc_node *node); 172static void tipc_node_timeout(struct timer_list *t); 173static void tipc_node_fsm_evt(struct tipc_node *n, int evt); 174static struct tipc_node *tipc_node_find(struct net *net, u32 addr); 175static struct tipc_node *tipc_node_find_by_id(struct net *net, u8 *id); |
171static void tipc_node_put(struct tipc_node *node); | |
172static bool node_is_up(struct tipc_node *n); 173static void tipc_node_delete_from_list(struct tipc_node *node); 174 175struct tipc_sock_conn { 176 u32 port; 177 u32 peer_port; 178 u32 peer_node; 179 struct list_head list; --- 73 unchanged lines hidden (view full) --- 253 return (node) ? node->addr : 0; 254} 255 256char *tipc_node_get_id_str(struct tipc_node *node) 257{ 258 return node->peer_id_string; 259} 260 | 176static bool node_is_up(struct tipc_node *n); 177static void tipc_node_delete_from_list(struct tipc_node *node); 178 179struct tipc_sock_conn { 180 u32 port; 181 u32 peer_port; 182 u32 peer_node; 183 struct list_head list; --- 73 unchanged lines hidden (view full) --- 257 return (node) ? node->addr : 0; 258} 259 260char *tipc_node_get_id_str(struct tipc_node *node) 261{ 262 return node->peer_id_string; 263} 264 |
265#ifdef CONFIG_TIPC_CRYPTO 266/** 267 * tipc_node_crypto_rx - Retrieve crypto RX handle from node 268 * Note: node ref counter must be held first! 269 */ 270struct tipc_crypto *tipc_node_crypto_rx(struct tipc_node *__n) 271{ 272 return (__n) ? __n->crypto_rx : NULL; 273} 274 275struct tipc_crypto *tipc_node_crypto_rx_by_list(struct list_head *pos) 276{ 277 return container_of(pos, struct tipc_node, list)->crypto_rx; 278} 279#endif 280 281void tipc_node_free(struct rcu_head *rp) 282{ 283 struct tipc_node *n = container_of(rp, struct tipc_node, rcu); 284 285#ifdef CONFIG_TIPC_CRYPTO 286 tipc_crypto_stop(&n->crypto_rx); 287#endif 288 kfree(n); 289} 290 |
|
261static void tipc_node_kref_release(struct kref *kref) 262{ 263 struct tipc_node *n = container_of(kref, struct tipc_node, kref); 264 265 kfree(n->bc_entry.link); | 291static void tipc_node_kref_release(struct kref *kref) 292{ 293 struct tipc_node *n = container_of(kref, struct tipc_node, kref); 294 295 kfree(n->bc_entry.link); |
266 kfree_rcu(n, rcu); | 296 call_rcu(&n->rcu, tipc_node_free); |
267} 268 | 297} 298 |
269static void tipc_node_put(struct tipc_node *node) | 299void tipc_node_put(struct tipc_node *node) |
270{ 271 kref_put(&node->kref, tipc_node_kref_release); 272} 273 274static void tipc_node_get(struct tipc_node *node) 275{ 276 kref_get(&node->kref); 277} --- 128 unchanged lines hidden (view full) --- 406 if (hash_mixes ^ hash_chk) 407 continue; 408 n->peer_net = tmp; 409 n->peer_hash_mix = hash_mixes; 410 break; 411 } 412} 413 | 300{ 301 kref_put(&node->kref, tipc_node_kref_release); 302} 303 304static void tipc_node_get(struct tipc_node *node) 305{ 306 kref_get(&node->kref); 307} --- 128 unchanged lines hidden (view full) --- 436 if (hash_mixes ^ hash_chk) 437 continue; 438 n->peer_net = tmp; 439 n->peer_hash_mix = hash_mixes; 440 break; 441 } 442} 443 |
414static struct tipc_node *tipc_node_create(struct net *net, u32 addr, 415 u8 *peer_id, u16 capabilities, 416 u32 hash_mixes, bool preliminary) | 444struct tipc_node *tipc_node_create(struct net *net, u32 addr, u8 *peer_id, 445 u16 capabilities, u32 hash_mixes, 446 bool preliminary) |
417{ 418 struct tipc_net *tn = net_generic(net, tipc_net_id); 419 struct tipc_node *n, *temp_node; 420 struct tipc_link *l; 421 unsigned long intv; 422 int bearer_id; 423 int i; 424 --- 44 unchanged lines hidden (view full) --- 469 goto exit; 470 } 471 n = kzalloc(sizeof(*n), GFP_ATOMIC); 472 if (!n) { 473 pr_warn("Node creation failed, no memory\n"); 474 goto exit; 475 } 476 tipc_nodeid2string(n->peer_id_string, peer_id); | 447{ 448 struct tipc_net *tn = net_generic(net, tipc_net_id); 449 struct tipc_node *n, *temp_node; 450 struct tipc_link *l; 451 unsigned long intv; 452 int bearer_id; 453 int i; 454 --- 44 unchanged lines hidden (view full) --- 499 goto exit; 500 } 501 n = kzalloc(sizeof(*n), GFP_ATOMIC); 502 if (!n) { 503 pr_warn("Node creation failed, no memory\n"); 504 goto exit; 505 } 506 tipc_nodeid2string(n->peer_id_string, peer_id); |
507#ifdef CONFIG_TIPC_CRYPTO 508 if (unlikely(tipc_crypto_start(&n->crypto_rx, net, n))) { 509 pr_warn("Failed to start crypto RX(%s)!\n", n->peer_id_string); 510 kfree(n); 511 n = NULL; 512 goto exit; 513 } 514#endif |
|
477 n->addr = addr; 478 n->preliminary = preliminary; 479 memcpy(&n->peer_id, peer_id, 16); 480 n->net = net; 481 n->peer_net = NULL; 482 n->peer_hash_mix = 0; 483 /* Assign kernel local namespace if exists */ 484 tipc_node_assign_peer_net(n, hash_mixes); --- 235 unchanged lines hidden (view full) --- 720 721 trace_tipc_node_timeout(n, false, " "); 722 if (!node_is_up(n) && tipc_node_cleanup(n)) { 723 /*Removing the reference of Timer*/ 724 tipc_node_put(n); 725 return; 726 } 727 | 515 n->addr = addr; 516 n->preliminary = preliminary; 517 memcpy(&n->peer_id, peer_id, 16); 518 n->net = net; 519 n->peer_net = NULL; 520 n->peer_hash_mix = 0; 521 /* Assign kernel local namespace if exists */ 522 tipc_node_assign_peer_net(n, hash_mixes); --- 235 unchanged lines hidden (view full) --- 758 759 trace_tipc_node_timeout(n, false, " "); 760 if (!node_is_up(n) && tipc_node_cleanup(n)) { 761 /*Removing the reference of Timer*/ 762 tipc_node_put(n); 763 return; 764 } 765 |
766#ifdef CONFIG_TIPC_CRYPTO 767 /* Take any crypto key related actions first */ 768 tipc_crypto_timeout(n->crypto_rx); 769#endif |
|
728 __skb_queue_head_init(&xmitq); 729 730 /* Initial node interval to value larger (10 seconds), then it will be 731 * recalculated with link lowest tolerance 732 */ 733 tipc_node_read_lock(n); 734 n->keepalive_intv = 10000; 735 tipc_node_read_unlock(n); --- 4 unchanged lines hidden (view full) --- 740 spin_lock_bh(&le->lock); 741 /* Link tolerance may change asynchronously: */ 742 tipc_node_calculate_timer(n, le->link); 743 rc = tipc_link_timeout(le->link, &xmitq); 744 spin_unlock_bh(&le->lock); 745 remains--; 746 } 747 tipc_node_read_unlock(n); | 770 __skb_queue_head_init(&xmitq); 771 772 /* Initial node interval to value larger (10 seconds), then it will be 773 * recalculated with link lowest tolerance 774 */ 775 tipc_node_read_lock(n); 776 n->keepalive_intv = 10000; 777 tipc_node_read_unlock(n); --- 4 unchanged lines hidden (view full) --- 782 spin_lock_bh(&le->lock); 783 /* Link tolerance may change asynchronously: */ 784 tipc_node_calculate_timer(n, le->link); 785 rc = tipc_link_timeout(le->link, &xmitq); 786 spin_unlock_bh(&le->lock); 787 remains--; 788 } 789 tipc_node_read_unlock(n); |
748 tipc_bearer_xmit(n->net, bearer_id, &xmitq, &le->maddr); | 790 tipc_bearer_xmit(n->net, bearer_id, &xmitq, &le->maddr, n); |
749 if (rc & TIPC_LINK_DOWN_EVT) 750 tipc_node_link_down(n, bearer_id, false); 751 } 752 mod_timer(&n->timer, jiffies + msecs_to_jiffies(n->keepalive_intv)); 753} 754 755/** 756 * __tipc_node_link_up - handle addition of link --- 15 unchanged lines hidden (view full) --- 772 if (!tipc_link_is_up(nl)) 773 return; 774 775 n->working_links++; 776 n->action_flags |= TIPC_NOTIFY_LINK_UP; 777 n->link_id = tipc_link_id(nl); 778 779 /* Leave room for tunnel header when returning 'mtu' to users: */ | 791 if (rc & TIPC_LINK_DOWN_EVT) 792 tipc_node_link_down(n, bearer_id, false); 793 } 794 mod_timer(&n->timer, jiffies + msecs_to_jiffies(n->keepalive_intv)); 795} 796 797/** 798 * __tipc_node_link_up - handle addition of link --- 15 unchanged lines hidden (view full) --- 814 if (!tipc_link_is_up(nl)) 815 return; 816 817 n->working_links++; 818 n->action_flags |= TIPC_NOTIFY_LINK_UP; 819 n->link_id = tipc_link_id(nl); 820 821 /* Leave room for tunnel header when returning 'mtu' to users: */ |
780 n->links[bearer_id].mtu = tipc_link_mtu(nl) - INT_H_SIZE; | 822 n->links[bearer_id].mtu = tipc_link_mss(nl); |
781 782 tipc_bearer_add_dest(n->net, bearer_id, n->addr); 783 tipc_bcast_inc_bearer_dst_cnt(n->net, bearer_id); 784 785 pr_debug("Established link <%s> on network plane %c\n", 786 tipc_link_name(nl), tipc_link_plane(nl)); 787 trace_tipc_node_link_up(n, true, " "); 788 --- 37 unchanged lines hidden (view full) --- 826static void tipc_node_link_up(struct tipc_node *n, int bearer_id, 827 struct sk_buff_head *xmitq) 828{ 829 struct tipc_media_addr *maddr; 830 831 tipc_node_write_lock(n); 832 __tipc_node_link_up(n, bearer_id, xmitq); 833 maddr = &n->links[bearer_id].maddr; | 823 824 tipc_bearer_add_dest(n->net, bearer_id, n->addr); 825 tipc_bcast_inc_bearer_dst_cnt(n->net, bearer_id); 826 827 pr_debug("Established link <%s> on network plane %c\n", 828 tipc_link_name(nl), tipc_link_plane(nl)); 829 trace_tipc_node_link_up(n, true, " "); 830 --- 37 unchanged lines hidden (view full) --- 868static void tipc_node_link_up(struct tipc_node *n, int bearer_id, 869 struct sk_buff_head *xmitq) 870{ 871 struct tipc_media_addr *maddr; 872 873 tipc_node_write_lock(n); 874 __tipc_node_link_up(n, bearer_id, xmitq); 875 maddr = &n->links[bearer_id].maddr; |
834 tipc_bearer_xmit(n->net, bearer_id, xmitq, maddr); | 876 tipc_bearer_xmit(n->net, bearer_id, xmitq, maddr, n); |
835 tipc_node_write_unlock(n); 836} 837 838/** 839 * tipc_node_link_failover() - start failover in case "half-failover" 840 * 841 * This function is only called in a very special situation where link 842 * failover can be already started on peer node but not on this node. --- 138 unchanged lines hidden (view full) --- 981 le->link = NULL; 982 n->link_cnt--; 983 } 984 trace_tipc_node_link_down(n, true, "node link down or deleted!"); 985 tipc_node_write_unlock(n); 986 if (delete) 987 tipc_mon_remove_peer(n->net, n->addr, old_bearer_id); 988 if (!skb_queue_empty(&xmitq)) | 877 tipc_node_write_unlock(n); 878} 879 880/** 881 * tipc_node_link_failover() - start failover in case "half-failover" 882 * 883 * This function is only called in a very special situation where link 884 * failover can be already started on peer node but not on this node. --- 138 unchanged lines hidden (view full) --- 1023 le->link = NULL; 1024 n->link_cnt--; 1025 } 1026 trace_tipc_node_link_down(n, true, "node link down or deleted!"); 1027 tipc_node_write_unlock(n); 1028 if (delete) 1029 tipc_mon_remove_peer(n->net, n->addr, old_bearer_id); 1030 if (!skb_queue_empty(&xmitq)) |
989 tipc_bearer_xmit(n->net, bearer_id, &xmitq, maddr); | 1031 tipc_bearer_xmit(n->net, bearer_id, &xmitq, maddr, n); |
990 tipc_sk_rcv(n->net, &le->inputq); 991} 992 993static bool node_is_up(struct tipc_node *n) 994{ 995 return n->active_links[0] != INVALID_BEARER_ID; 996} 997 --- 637 unchanged lines hidden (view full) --- 1635 spin_lock_bh(&le->lock); 1636 rc = tipc_link_xmit(le->link, list, &xmitq); 1637 spin_unlock_bh(&le->lock); 1638 tipc_node_read_unlock(n); 1639 1640 if (unlikely(rc == -ENOBUFS)) 1641 tipc_node_link_down(n, bearer_id, false); 1642 else | 1032 tipc_sk_rcv(n->net, &le->inputq); 1033} 1034 1035static bool node_is_up(struct tipc_node *n) 1036{ 1037 return n->active_links[0] != INVALID_BEARER_ID; 1038} 1039 --- 637 unchanged lines hidden (view full) --- 1677 spin_lock_bh(&le->lock); 1678 rc = tipc_link_xmit(le->link, list, &xmitq); 1679 spin_unlock_bh(&le->lock); 1680 tipc_node_read_unlock(n); 1681 1682 if (unlikely(rc == -ENOBUFS)) 1683 tipc_node_link_down(n, bearer_id, false); 1684 else |
1643 tipc_bearer_xmit(net, bearer_id, &xmitq, &le->maddr); | 1685 tipc_bearer_xmit(net, bearer_id, &xmitq, &le->maddr, n); |
1644 1645 tipc_node_put(n); 1646 1647 return rc; 1648} 1649 1650/* tipc_node_xmit_skb(): send single buffer to destination 1651 * Buffers sent via this functon are generally TIPC_SYSTEM_IMPORTANCE --- 131 unchanged lines hidden (view full) --- 1783 /* Broadcast ACKs are sent on a unicast link */ 1784 if (rc & TIPC_LINK_SND_STATE) { 1785 tipc_node_read_lock(n); 1786 tipc_link_build_state_msg(le->link, &xmitq); 1787 tipc_node_read_unlock(n); 1788 } 1789 1790 if (!skb_queue_empty(&xmitq)) | 1686 1687 tipc_node_put(n); 1688 1689 return rc; 1690} 1691 1692/* tipc_node_xmit_skb(): send single buffer to destination 1693 * Buffers sent via this functon are generally TIPC_SYSTEM_IMPORTANCE --- 131 unchanged lines hidden (view full) --- 1825 /* Broadcast ACKs are sent on a unicast link */ 1826 if (rc & TIPC_LINK_SND_STATE) { 1827 tipc_node_read_lock(n); 1828 tipc_link_build_state_msg(le->link, &xmitq); 1829 tipc_node_read_unlock(n); 1830 } 1831 1832 if (!skb_queue_empty(&xmitq)) |
1791 tipc_bearer_xmit(net, bearer_id, &xmitq, &le->maddr); | 1833 tipc_bearer_xmit(net, bearer_id, &xmitq, &le->maddr, n); |
1792 1793 if (!skb_queue_empty(&be->inputq1)) 1794 tipc_node_mcast_rcv(n); 1795 1796 /* Handle NAME_DISTRIBUTOR messages sent from 1.7 nodes */ 1797 if (!skb_queue_empty(&n->bc_entry.namedq)) 1798 tipc_named_rcv(net, &n->bc_entry.namedq); 1799 --- 161 unchanged lines hidden (view full) --- 1961 * @bearer: pointer to bearer message arrived on 1962 * 1963 * Invoked with no locks held. Bearer pointer must point to a valid bearer 1964 * structure (i.e. cannot be NULL), but bearer can be inactive. 1965 */ 1966void tipc_rcv(struct net *net, struct sk_buff *skb, struct tipc_bearer *b) 1967{ 1968 struct sk_buff_head xmitq; | 1834 1835 if (!skb_queue_empty(&be->inputq1)) 1836 tipc_node_mcast_rcv(n); 1837 1838 /* Handle NAME_DISTRIBUTOR messages sent from 1.7 nodes */ 1839 if (!skb_queue_empty(&n->bc_entry.namedq)) 1840 tipc_named_rcv(net, &n->bc_entry.namedq); 1841 --- 161 unchanged lines hidden (view full) --- 2003 * @bearer: pointer to bearer message arrived on 2004 * 2005 * Invoked with no locks held. Bearer pointer must point to a valid bearer 2006 * structure (i.e. cannot be NULL), but bearer can be inactive. 2007 */ 2008void tipc_rcv(struct net *net, struct sk_buff *skb, struct tipc_bearer *b) 2009{ 2010 struct sk_buff_head xmitq; |
1969 struct tipc_node *n; | 2011 struct tipc_link_entry *le; |
1970 struct tipc_msg *hdr; | 2012 struct tipc_msg *hdr; |
2013 struct tipc_node *n; |
|
1971 int bearer_id = b->identity; | 2014 int bearer_id = b->identity; |
1972 struct tipc_link_entry *le; | |
1973 u32 self = tipc_own_addr(net); 1974 int usr, rc = 0; 1975 u16 bc_ack; | 2015 u32 self = tipc_own_addr(net); 2016 int usr, rc = 0; 2017 u16 bc_ack; |
2018#ifdef CONFIG_TIPC_CRYPTO 2019 struct tipc_ehdr *ehdr; |
|
1976 | 2020 |
1977 __skb_queue_head_init(&xmitq); | 2021 /* Check if message must be decrypted first */ 2022 if (TIPC_SKB_CB(skb)->decrypted || !tipc_ehdr_validate(skb)) 2023 goto rcv; |
1978 | 2024 |
2025 ehdr = (struct tipc_ehdr *)skb->data; 2026 if (likely(ehdr->user != LINK_CONFIG)) { 2027 n = tipc_node_find(net, ntohl(ehdr->addr)); 2028 if (unlikely(!n)) 2029 goto discard; 2030 } else { 2031 n = tipc_node_find_by_id(net, ehdr->id); 2032 } 2033 tipc_crypto_rcv(net, (n) ? n->crypto_rx : NULL, &skb, b); 2034 if (!skb) 2035 return; 2036 2037rcv: 2038#endif |
|
1979 /* Ensure message is well-formed before touching the header */ | 2039 /* Ensure message is well-formed before touching the header */ |
1980 TIPC_SKB_CB(skb)->validated = false; | |
1981 if (unlikely(!tipc_msg_validate(&skb))) 1982 goto discard; | 2040 if (unlikely(!tipc_msg_validate(&skb))) 2041 goto discard; |
2042 __skb_queue_head_init(&xmitq); |
|
1983 hdr = buf_msg(skb); 1984 usr = msg_user(hdr); 1985 bc_ack = msg_bcast_ack(hdr); 1986 1987 /* Handle arrival of discovery or broadcast packet */ 1988 if (unlikely(msg_non_seq(hdr))) { 1989 if (unlikely(usr == LINK_CONFIG)) 1990 return tipc_disc_rcv(net, skb, b); --- 54 unchanged lines hidden (view full) --- 2045 2046 if (unlikely(!skb_queue_empty(&n->bc_entry.inputq1))) 2047 tipc_node_mcast_rcv(n); 2048 2049 if (!skb_queue_empty(&le->inputq)) 2050 tipc_sk_rcv(net, &le->inputq); 2051 2052 if (!skb_queue_empty(&xmitq)) | 2043 hdr = buf_msg(skb); 2044 usr = msg_user(hdr); 2045 bc_ack = msg_bcast_ack(hdr); 2046 2047 /* Handle arrival of discovery or broadcast packet */ 2048 if (unlikely(msg_non_seq(hdr))) { 2049 if (unlikely(usr == LINK_CONFIG)) 2050 return tipc_disc_rcv(net, skb, b); --- 54 unchanged lines hidden (view full) --- 2105 2106 if (unlikely(!skb_queue_empty(&n->bc_entry.inputq1))) 2107 tipc_node_mcast_rcv(n); 2108 2109 if (!skb_queue_empty(&le->inputq)) 2110 tipc_sk_rcv(net, &le->inputq); 2111 2112 if (!skb_queue_empty(&xmitq)) |
2053 tipc_bearer_xmit(net, bearer_id, &xmitq, &le->maddr); | 2113 tipc_bearer_xmit(net, bearer_id, &xmitq, &le->maddr, n); |
2054 2055 tipc_node_put(n); 2056discard: 2057 kfree_skb(skb); 2058} 2059 2060void tipc_node_apply_property(struct net *net, struct tipc_bearer *b, 2061 int prop) --- 14 unchanged lines hidden (view full) --- 2076 if (e->link) { 2077 if (prop == TIPC_NLA_PROP_TOL) 2078 tipc_link_set_tolerance(e->link, b->tolerance, 2079 &xmitq); 2080 else if (prop == TIPC_NLA_PROP_MTU) 2081 tipc_link_set_mtu(e->link, b->mtu); 2082 } 2083 tipc_node_write_unlock(n); | 2114 2115 tipc_node_put(n); 2116discard: 2117 kfree_skb(skb); 2118} 2119 2120void tipc_node_apply_property(struct net *net, struct tipc_bearer *b, 2121 int prop) --- 14 unchanged lines hidden (view full) --- 2136 if (e->link) { 2137 if (prop == TIPC_NLA_PROP_TOL) 2138 tipc_link_set_tolerance(e->link, b->tolerance, 2139 &xmitq); 2140 else if (prop == TIPC_NLA_PROP_MTU) 2141 tipc_link_set_mtu(e->link, b->mtu); 2142 } 2143 tipc_node_write_unlock(n); |
2084 tipc_bearer_xmit(net, bearer_id, &xmitq, &e->maddr); | 2144 tipc_bearer_xmit(net, bearer_id, &xmitq, &e->maddr, NULL); |
2085 } 2086 2087 rcu_read_unlock(); 2088} 2089 2090int tipc_nl_peer_rm(struct sk_buff *skb, struct genl_info *info) 2091{ 2092 struct net *net = sock_net(skb->sk); --- 225 unchanged lines hidden (view full) --- 2318 2319 win = nla_get_u32(props[TIPC_NLA_PROP_WIN]); 2320 tipc_link_set_queue_limits(link, win); 2321 } 2322 } 2323 2324out: 2325 tipc_node_read_unlock(node); | 2145 } 2146 2147 rcu_read_unlock(); 2148} 2149 2150int tipc_nl_peer_rm(struct sk_buff *skb, struct genl_info *info) 2151{ 2152 struct net *net = sock_net(skb->sk); --- 225 unchanged lines hidden (view full) --- 2378 2379 win = nla_get_u32(props[TIPC_NLA_PROP_WIN]); 2380 tipc_link_set_queue_limits(link, win); 2381 } 2382 } 2383 2384out: 2385 tipc_node_read_unlock(node); |
2326 tipc_bearer_xmit(net, bearer_id, &xmitq, &node->links[bearer_id].maddr); | 2386 tipc_bearer_xmit(net, bearer_id, &xmitq, &node->links[bearer_id].maddr, 2387 NULL); |
2327 return res; 2328} 2329 2330int tipc_nl_node_get_link(struct sk_buff *skb, struct genl_info *info) 2331{ 2332 struct net *net = genl_info_net(info); 2333 struct nlattr *attrs[TIPC_NLA_LINK_MAX + 1]; 2334 struct tipc_nl_msg msg; --- 453 unchanged lines hidden --- | 2388 return res; 2389} 2390 2391int tipc_nl_node_get_link(struct sk_buff *skb, struct genl_info *info) 2392{ 2393 struct net *net = genl_info_net(info); 2394 struct nlattr *attrs[TIPC_NLA_LINK_MAX + 1]; 2395 struct tipc_nl_msg msg; --- 453 unchanged lines hidden --- |