summaryrefslogtreecommitdiff
path: root/tipc
Commit message (Collapse)AuthorAgeFilesLines
* tipc: use SPDXStephen Hemminger2023-01-1421-105/+21
| | | | | | Replace boilerplate GPL text with SPDX Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
* tipc: fix keylen checkAndrea Claudi2022-05-171-3/+2
| | | | | | | | | | Key length check in str2key() is wrong for hex. Fix this using the proper hex key length. Fixes: 28ee49e5153b ("tipc: bail out if key is abnormally long") Suggested-by: Xin Long <lucien.xin@gmail.com> Signed-off-by: Andrea Claudi <aclaudi@redhat.com> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
* Makefile: move HAVE_MNL check to top-level MakefileAndrea Claudi2022-03-121-6/+0
| | | | | | | | | | | dcb, devlink, rdma, tipc and vdpa rely on libmnl to compile, so they check for libmnl to be installed on their Makefiles. This moves HAVE_MNL check from the tools to top-level Makefile, thus avoiding to call their Makefiles if libmnl is not present. Signed-off-by: Andrea Claudi <aclaudi@redhat.com> Signed-off-by: David Ahern <dsahern@kernel.org>
* tipc: fix clang warning about empty format stringStephen Hemminger2022-01-261-1/+1
| | | | | | | | When calling json_print with json only use a NULL instead of empty string. Signed-off-by: Stephen Hemminger <stephen@networkplumber.org> Signed-off-by: David Ahern <dsahern@kernel.org>
* tipc: bail out if key is abnormally longAndrea Claudi2021-05-091-0/+3
| | | | | | | | | | | | | | tipc segfaults when called with an abnormally long key: $ tipc node set key 0123456789abcdef0123456789abcdef0123456789abcdef *** buffer overflow detected ***: terminated Fix this returning an error if key length is longer than TIPC_AEAD_KEYLEN_MAX. Fixes: 24bee3bf9752 ("tipc: add new commands to set TIPC AEAD key") Signed-off-by: Andrea Claudi <aclaudi@redhat.com> Signed-off-by: David Ahern <dsahern@kernel.org>
* tipc: bail out if algname is abnormally longAndrea Claudi2021-05-091-2/+7
| | | | | | | | | | | | | | tipc segfaults when called with an abnormally long algname: $ tipc node set key 0x1234 algname supercalifragilistichespiralidososupercalifragilistichespiralidoso *** buffer overflow detected ***: terminated Fix this returning an error if provided algname is longer than TIPC_AEAD_ALG_NAME. Fixes: 24bee3bf9752 ("tipc: add new commands to set TIPC AEAD key") Signed-off-by: Andrea Claudi <aclaudi@redhat.com> Signed-off-by: David Ahern <dsahern@kernel.org>
* tipc: call a sub-routine in separate socketHoang Le2021-05-093-9/+73
| | | | | | | | | | | | | When receiving a result from first query to netlink, we may exec a another query inside the callback. If calling this sub-routine in the same socket, it will be discarded the result from previous exection. To avoid this we perform a nested query in separate socket. Fixes: 202102830663 ("tipc: use the libmnl functions in lib/mnl_utils.c") Signed-off-by: Hoang Le <hoang.h.le@dektech.com.au> Acked-by: Jon Maloy <jmaloy@redhat.com> Signed-off-by: David Ahern <dsahern@kernel.org>
* tipc: use the libmnl functions in lib/mnl_utils.cHoang Le2021-04-0311-220/+83
| | | | | | | | | To avoid code duplication, tipc should be converted to use the helper functions for working with libmnl in lib/mnl_utils.c Acked-by: Jon Maloy <jmaloy@redhat.com> Signed-off-by: Hoang Le <hoang.h.le@dektech.com.au> Signed-off-by: David Ahern <dsahern@kernel.org>
* tipc: add option to set rekeying for encryptionTuong Lien2020-10-203-11/+39
| | | | | | | | | | | | | | | | | | | | | | | | | As supported in kernel, the TIPC encryption rekeying can be tuned using the netlink attribute - 'TIPC_NLA_NODE_REKEYING'. Now we add the 'rekeying' option correspondingly to the 'tipc node set key' command so that user will be able to perform that tuning: tipc node set key rekeying REKEYING where the 'REKEYING' value can be: INTERVAL - Set rekeying interval (in minutes) [0: disable] now - Trigger one (first) rekeying immediately For example: $ tipc node set key rekeying 60 $ tipc node set key rekeying now The command's help menu is also updated with these descriptions for the new command option. Acked-by: Jon Maloy <jmaloy@redhat.com> Signed-off-by: Tuong Lien <tuong.t.lien@dektech.com.au> Signed-off-by: David Ahern <dsahern@gmail.com>
* tipc: add option to set master key for encryptionTuong Lien2020-10-201-17/+29
| | | | | | | | | | | | | | | | | In addition to the support of master key in kernel, we add the 'master' option to the 'tipc node set key' command for user to be able to specify a key as master key during the key setting. This is carried out by turning on the new netlink flag - 'TIPC_NLA_NODE_KEY_MASTER'. For example: $ tipc node set key "this_is_a_master_key" master The command's help menu is also updated to give a better description of all the available options. Acked-by: Jon Maloy <jmaloy@redhat.com> Signed-off-by: Tuong Lien <tuong.t.lien@dektech.com.au> Signed-off-by: David Ahern <dsahern@gmail.com>
* tipc: support 128bit node identity for peer removingHoang Le2020-09-011-1/+52
| | | | | | | | | | | | | | | | | | | | | | | | Problem: In kernel upstream, we add the support to set node identity with 128bit. However, we are still using legacy format in command tipc peer removing. Then, we got a problem when trying to remove offline node i.e: $ tipc node list Node Identity Hash State d6babc1c1c6d 1cbcd7ca down $ tipc peer remove address d6babc1c1c6d invalid network address, syntax: Z.C.N error: No such device or address Solution: We add the support to remove a specific node down with 128bit node identifier, as an alternative to legacy 32-bit node address. Acked-by: Jon Maloy <jmaloy@redhat.com> Signed-off-by: Hoang Huu Le <hoang.h.le@dektech.com.au> Signed-off-by: David Ahern <dsahern@gmail.com>
* tipc: fixed a compile warning in tipc/link.cHoang Huu Le2020-07-131-1/+1
| | | | | | | Fixes: 5027f233e35b ("tipc: add link broadcast get") Signed-off-by: Hoang Huu Le <hoang.h.le@dektech.com.au> Acked-by: Jon Maloy <jmaloy@redhat.com> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
* tipc: enable printing of broadcast rcv link statsTuong Lien2020-05-271-8/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit allows printing the statistics of a broadcast-receiver link using the same tipc command, but with additional 'link' options: $ tipc link stat show --help Usage: tipc link stat show [ link { LINK | SUBSTRING | all } ] With: + 'LINK' : print the stats of the specific link 'LINK'; + 'SUBSTRING' : print the stats of all the links having the 'SUBSTRING' in name; + 'all' : print all the links' stats incl. the broadcast-receiver ones; Also, a link stats can be reset in the usual way by specifying the link name in command. For example: $ tipc l st sh l br Link <broadcast-link> Window:50 packets RX packets:0 fragments:0/0 bundles:0/0 TX packets:5011125 fragments:4968774/149643 bundles:38402/307061 RX naks:781484 defs:0 dups:0 TX naks:0 acks:0 retrans:330259 Congestion link:50657 Send queue max:0 avg:0 Link <broadcast-link:1001001> Window:50 packets RX packets:95146 fragments:95040/1980 bundles:1/2 TX packets:0 fragments:0/0 bundles:0/0 RX naks:380938 defs:83962 dups:403 TX naks:8362 acks:0 retrans:170662 Congestion link:0 Send queue max:0 avg:0 Link <broadcast-link:1001002> Window:50 packets RX packets:0 fragments:0/0 bundles:0/0 TX packets:0 fragments:0/0 bundles:0/0 RX naks:400546 defs:0 dups:0 TX naks:0 acks:0 retrans:159597 Congestion link:0 Send queue max:0 avg:0 $ tipc l st sh l 1001002 Link <1001003:data0-1001002:data0> ACTIVE MTU:1500 Priority:10 Tolerance:1500 ms Window:50 packets RX packets:99546 fragments:0/0 bundles:33/877 TX packets:629 fragments:0/0 bundles:35/828 TX profile sample:8 packets average:390 octets 0-64:75% -256:0% -1024:0% -4096:25% -16384:0% -32768:0% -66000:0% RX states:488714 probes:7397 naks:0 defs:4 dups:5 TX states:27734 probes:18016 naks:5 acks:2305 retrans:0 Congestion link:0 Send queue max:0 avg:0 Link <broadcast-link:1001002> Window:50 packets RX packets:0 fragments:0/0 bundles:0/0 TX packets:0 fragments:0/0 bundles:0/0 RX naks:400546 defs:0 dups:0 TX naks:0 acks:0 retrans:159597 Congestion link:0 Send queue max:0 avg:0 $ tipc l st re l broadcast-link:1001002 $ tipc l st sh l broadcast-link:1001002 Link <broadcast-link:1001002> Window:50 packets RX packets:0 fragments:0/0 bundles:0/0 TX packets:0 fragments:0/0 bundles:0/0 RX naks:0 defs:0 dups:0 TX naks:0 acks:0 retrans:0 Congestion link:0 Send queue max:0 avg:0 Acked-by: Ying Xue <ying.xue@windriver.com> Acked-by: Jon Maloy <jmaloy@redhat.com> Signed-off-by: Tuong Lien <tuong.t.lien@dektech.com.au> Signed-off-by: David Ahern <dsahern@gmail.com>
* build: fix build failure with -fno-commonJan Engelhardt2020-01-201-1/+1
| | | | | | | | | | | | | | | $ make CCOPTS=-fno-common gcc ... -o ip ld: rt_names.o (symbol from plugin): in function "rtnl_rtprot_n2a": (.text+0x0): multiple definition of "numeric"; ip.o (symbol from plugin):(.text+0x0): first defined here gcc ... -o tipc ld: ../lib/libutil.a(utils.o):(.bss+0xc): multiple definition of `pretty'; tipc.o:tipc.c:28: first defined here References: https://bugzilla.opensuse.org/1160244 Signed-off-by: Jan Engelhardt <jengelh@inai.de> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
* tipc: fix clang warning in tipc/node.cTuong Lien2020-01-061-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | When building tipc with clang, the following warning is found: tipc CC bearer.o CC cmdl.o CC link.o CC media.o CC misc.o CC msg.o CC nametable.o CC node.o node.c:182:24: warning: field 'key' with variable sized type 'struct tipc_aead_key' not at the end of a struct or class is a GNU extension [-Wgnu-variable-sized-type-not-at-end] struct tipc_aead_key key; This commit fixes it by putting the memory area allocated for the user input key along with the variable-sized 'key' structure in the 'union' form instead. Fixes: 24bee3bf9752 ("tipc: add new commands to set TIPC AEAD key") Reported-by: Stephen Hemminger <stephen@networkplumber.org> Signed-off-by: Tuong Lien <tuong.t.lien@dektech.com.au> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
* tipc: add new commands to set TIPC AEAD keyTuong Lien2019-11-253-2/+170
| | | | | | | | | | | | | | | | | | | | | | | | | | | Two new commands are added as part of 'tipc node' command: $tipc node set key KEY [algname ALGNAME] [nodeid NODEID] $tipc node flush key which enable user to set and remove AEAD keys in kernel TIPC (requires the kernel option - 'TIPC_CRYPTO'). For the 'set key' command, the given 'nodeid' parameter decides the mode to be applied to the key, particularly: - If NODEID is empty, the key is a 'cluster' key which will be used for all message encryption/decryption from/to the node (i.e. both TX & RX). The same key will be set in the other nodes. - If NODEID is own node, the key is used for message encryption (TX) from the node. Whereas, if NODEID is a peer node, the key is for message decryption (RX) from that peer node. This is the 'per-node-key' mode that each nodes in the cluster has its specific (TX) key. Acked-by: Ying Xue <ying.xue@windriver.com> Acked-by: Jon Maloy <jon.maloy@ericsson.com> Signed-off-by: Tuong Lien <tuong.t.lien@dektech.com.au> Signed-off-by: David Ahern <dsahern@gmail.com>
* tipc: support interface name when activating UDP bearerHoang Le2019-06-281-5/+89
| | | | | | | | | | | | | | | | | | | | | | | | | Support for indicating interface name has an ip address in parallel with specifying ip address when activating UDP bearer. This liberates the user from keeping track of the current ip address for each device. Old command syntax: $tipc bearer enable media udp name NAME localip IP New command syntax: $tipc bearer enable media udp name NAME [localip IP|dev DEVICE] v2: - Removed initial value for fd - Fixed the returning value for cmd_bearer_validate_and_get_addr to make its consistent with using: zero or non-zero v3: - Switch to use helper 'get_ifname' to retrieve interface name v4: - Replace legacy SIOCGIFADDR by netlink v5: - Fix leaky rtnl_handle Acked-by: Ying Xue <ying.xue@windriver.com> Signed-off-by: Hoang Le <hoang.h.le@dektech.com.au> Signed-off-by: David Ahern <dsahern@gmail.com>
* treewide: refactor help messagesMatteo Croce2019-05-201-23/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Every tool in the iproute2 package have one or more function to show an help message to the user. Some of these functions print the help line by line with a series of printf call, e.g. ip/xfrm_state.c does 60 fprintf calls. If we group all the calls to a single one and just concatenate strings, we save a lot of libc calls and thus object size. The size difference of the compiled binaries calculated with bloat-o-meter is: ip/ip: add/remove: 0/0 grow/shrink: 5/15 up/down: 103/-4796 (-4693) Total: Before=672591, After=667898, chg -0.70% ip/rtmon: add/remove: 0/0 grow/shrink: 0/1 up/down: 0/-54 (-54) Total: Before=48879, After=48825, chg -0.11% tc/tc: add/remove: 0/2 grow/shrink: 31/10 up/down: 882/-6133 (-5251) Total: Before=351912, After=346661, chg -1.49% bridge/bridge: add/remove: 0/0 grow/shrink: 0/1 up/down: 0/-459 (-459) Total: Before=70502, After=70043, chg -0.65% misc/lnstat: add/remove: 0/1 grow/shrink: 1/0 up/down: 48/-486 (-438) Total: Before=9960, After=9522, chg -4.40% tipc/tipc: add/remove: 0/0 grow/shrink: 1/1 up/down: 18/-62 (-44) Total: Before=79182, After=79138, chg -0.06% While at it, indent some strings which were starting at column 0, and use tabs where possible, to have a consistent style across helps. Signed-off-by: Matteo Croce <mcroce@redhat.com> Signed-off-by: David Ahern <dsahern@gmail.com>
* tipc: add link broadcast getHoang Le2019-03-261-1/+84
| | | | | | | | | | | | | | | | | | | | | | | | The command prints the actually method that multicast is running in the system. Also 'ratio' value for AUTOSELECT method. A sample usage is shown below: $tipc link get broadcast BROADCAST $tipc link get broadcast AUTOSELECT ratio:30% $tipc link get broadcast -j -p [ { "method": "AUTOSELECT" },{ "ratio": 30 } ] Acked-by: Jon Maloy <jon.maloy@ericsson.com> Signed-off-by: Hoang Le <hoang.h.le@dektech.com.au> Signed-off-by: David Ahern <dsahern@gmail.com>
* tipc: add link broadcast set method and ratioHoang Le2019-03-261-1/+95
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The command added here makes it possible to forcibly configure the broadcast link to use either broadcast or replicast, in addition to the already existing auto selection algorithm. A sample usage is shown below: $tipc link set broadcast BROADCAST $tipc link set broadcast AUTOSELECT ratio 25 $tipc link set broadcast -h Usage: tipc link set broadcast PROPERTY PROPERTIES BROADCAST - Forces all multicast traffic to be transmitted via broadcast only, irrespective of cluster size and number of destinations REPLICAST - Forces all multicast traffic to be transmitted via replicast only, irrespective of cluster size and number of destinations AUTOSELECT - Auto switching to broadcast or replicast depending on cluster size and destination node number ratio SIZE - Set the AUTOSELECT criteria, percentage of destination nodes vs cluster size Acked-by: Jon Maloy <jon.maloy@ericsson.com> Signed-off-by: Hoang Le <hoang.h.le@dektech.com.au> Signed-off-by: David Ahern <dsahern@gmail.com>
* tipc: fix misalignment printout in non-JSON outputHoang Le2018-12-071-0/+5
| | | | | | | | | | | | | | | | | | | | | | In the commit 1304f50a5be0ed ("tipc: JSON support for showing nametable"), introduced misalignment in the columns of the printout in non-JSON mode compare to the list header. Add one space per column to make alignment with the list header. before: $tipc name show Type Lower Upper Scope Port Node 1 1 1 node 4071367628 after: $tipc name show Type Lower Upper Scope Port Node 1 1 1 node 4071367628 Reported-by: Jon Maloy <jon.maloy@ericsson.com> Acked-by: Jon Maloy <jon.maloy@ericsson.com> Signed-off-by: Hoang Le <hoang.h.le@dektech.com.au> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
* iproute2: Installation errors without libmnlEmeric Dupont2018-12-041-1/+3
| | | | | | | | | When performing make install in iproute2 (current git master), if $(HAVE_MNL) is not selected, some Makefiles try to call install with an empty target, which causes a non-critical make error. Signed-off-by: Emeric Dupont <emeric.dupont@zii.aero> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
* tipc: make cmd_find staticStephen Hemminger2018-11-192-3/+1
| | | | | | Function only used in one file. Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
* tipc: Drop unused variable 'genl'Phil Sutter2018-10-221-6/+3
| | | | | | | | | Although initialized by call to libmnl, the variable is used only in a call to sizeof(). Drop it and call sizeof with its type instead. Fixes: f043759dd4928 ("tipc: add new TIPC configuration tool") Signed-off-by: Phil Sutter <phil@nwl.cc> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
* tipc: spelling fixStephen Hemminger2018-10-181-1/+1
|
* tipc: JSON support for tipc link printoutsHoang Le2018-06-131-142/+272
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add json output support for tipc link command Example output: $tipc -j -p link list [ { "broadcast-link": "up", "1.1.1:bridge-1.1.104:eth0": "up", "1.1.1:bridge-1.1.105:eth0": "up", "1.1.1:bridge-1.1.106:eth0": "up" } ] -------------------- $tipc -j -p link stat show link broadcast-link [ { "link": "broadcast-link", "window": 50, "rx packets": { "rx packets": 0, "fragments": 0, "fragmented": 0, "bundles": 0, "bundled": 0 }, "tx packets": { "tx packets": 0, "fragments": 0, "fragmented": 0, "bundles": 0, "bundled": 0 }, "rx naks": { "rx naks": 0, "defs": 0, "dups": 0 }, "tx naks": { "tx naks": 0, "acks": 0, "retrans": 0 }, "congestion link": 0, "send queue max": 0, "avg": 0 } ] v2: Replace variable 'json_flag' by 'json' declared in include/utils.h v3: Update manual page Acked-by: Jon Maloy <jon.maloy@ericsson.com> Signed-off-by: Hoang Le <hoang.h.le@dektech.com.au> Signed-off-by: David Ahern <dsahern@gmail.com>
* tipc: JSON support for showing nametableHoang Le2018-06-132-10/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add json output support for nametable show Example output: $tipc -j -p nametable show [ { "type": 0, "lower": 16781313, "upper": 16781313, "scope": "zone", "port": 0, "node": "" },{ "type": 0, "lower": 16781416, "upper": 16781416, "scope": "cluster", "port": 0, "node": "" } ] v2: Replace variable 'json_flag' by 'json' declared in include/utils.h Add new parameter '-pretty' to support pretty output v3: Update manual page Acked-by: Jon Maloy <jon.maloy@ericsson.com> Signed-off-by: Hoang Le <hoang.h.le@dektech.com.au> Signed-off-by: David Ahern <dsahern@gmail.com>
* Merge ../iproute2-nextStephen Hemminger2018-06-087-30/+111
|\
| * tipc: fixed node and name table listingsJon Maloy2018-05-185-19/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | We make it easier for users to correlate between 128-bit node identities and 32-bit node hash number by extending the 'node list' command to also show the hash number. We also improve the 'nametable show' command to show the node identity instead of the node hash number. Since the former potentially is much longer than the latter, we make room for it by eliminating the (to the user) irrelevant publication key. We also reorder some of the columns so that the node id comes last, since this looks nicer and is more logical. Signed-off-by: David Ahern <dsahern@gmail.com>
| * tipc: Add support to set and get MTU for UDP bearerGhantaKrishnamurthy MohanKrishna2018-05-092-11/+68
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In this commit we introduce the ability to set and get MTU for UDP media and bearer. For set and get properties such as tolerance, window and priority, we already do: $ tipc media set PPROPERTY media MEDIA $ tipc media get PPROPERTY media MEDIA $ tipc bearer set OPTION media MEDIA ARGS $ tipc bearer get [OPTION] media MEDIA ARGS The same has been extended for MTU, with an exception to support only media type UDP. Acked-by: Jon Maloy <jon.maloy@ericsson.com> Signed-off-by: GhantaKrishnamurthy MohanKrishna <mohan.krishna.ghanta.krishnamurthy@ericsson.com> Signed-off-by: David Ahern <dsahern@gmail.com>
* | tipc: TIPC_NLA_LINK_NAME value pass on nesting entry TIPC_NLA_LINKHoang Le2018-06-081-0/+3
|/ | | | | | | | | | | | | In the commit 94f6a80 on next-net, TIPC_NLA_LINK_NAME attribute should be retrieved and validated via TIPC_NLA_LINK nesting entry in tipc_nl_node_get_link(). According to that commit, TIPC_NLA_LINK_NAME value passing via tipc link get command must follow above hierachy. Acked-by: Ying Xue <ying.xue@windriver.com> Signed-off-by: Hoang Le <hoang.h.le@dektech.com.au> Acked-by: Jon Maloy <jon.maloy@ericsson.com> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
* tipc: change node address printout formatsJon Maloy2018-03-284-24/+9
| | | | | | | | | | | | Since a node address now per definition is only an unstructured 32-bit integer it makes no sense print it out as a structured string. In this commit, we replace all occurrences of "<Z.C.N>" printouts with just an "%x". Acked-by: GhantaKrishnamurthy MohanKrishna <mohan.krishna.ghanta.krishnamurthy@ericsson.com> Signed-off-by: Jon Maloy <jon.maloy@ericsson.com> Signed-off-by: David Ahern <dsahern@gmail.com>
* tipc: introduce command for handling a new 128-bit node identityJon Maloy2018-03-283-6/+172
| | | | | | | | | | | | | | We add the possibility to set and get a 128 bit node identifier, as an alternative to the legacy 32-bit node address we are using now. We also add an option to set and get 'clusterid' in the node. This is the same as what we have so far called 'netid' and performs the same operations. For compatibility the old 'netid' commands are retained, -we just remove them from the help texts. Acked-by: GhantaKrishnamurthy MohanKrishna <mohan.krishna.ghanta.krishnamurthy@ericsson.com> Signed-off-by: Jon Maloy <jon.maloy@ericsson.com> Signed-off-by: David Ahern <dsahern@gmail.com>
* devlink, rdma, tipc: properly define TARGETS without HAVE_MNLMatthias Schiffer2018-01-051-1/+3
| | | | | | | | Leaving a variable with a generic name such as TARGETS undefined would lead to Make picking up its value from the environment. Avoid this by always defining TARGETS in the Makefiles. Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
* SPDX license identifiersStephen Hemminger2017-11-241-0/+1
| | | | | | | For all files in iproute2 which do not have an obvious license identification, mark them with SPDK GPL-2 Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
* tipc: change family attribute from u32 to u16Jon Maloy2017-11-161-1/+1
| | | | | | | | | | | | | commit 28033ae4e0f ("net: netlink: Update attr validation to require exact length for some types") introduces a stricter control on attributes of type NLA_U* and NLA_S*. Since the tipc tool is sending a family attribute of u32 instead of as expected u16 the tool is now effectively broken. We fix this by changing the type of the said attribute. Signed-off-by: Jon Maloy <jon.maloy@ericsson.com>
* tipc: don't need custom CFLAGSStephen Hemminger2017-10-111-2/+0
| | | | | | Since libmnl CFLAGS are now handled by config.mk Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
* Merge branch 'master' into net-nextStephen Hemminger2017-08-241-1/+1
|\
| * tipc/bearer: Prevent NULL pointer dereferencePhil Sutter2017-08-241-1/+1
| | | | | | | | Signed-off-by: Phil Sutter <phil@nwl.cc>
* | config: put CFLAGS/LDLIBS in config.mkStephen Hemminger2017-08-231-3/+2
|/ | | | | | | | | | | This renames Config to config.mk and includes more Make input. Now configure generates all the required CFLAGS and LDLIBS for the optional libraries. Also, use pkg-config to test for libelf, rather than using a test program. This makes it consistent with other libraries. Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
* tipc/bearer: Fix resource leak in error pathPhil Sutter2017-08-181-0/+3
| | | | Signed-off-by: Phil Sutter <phil@nwl.cc>
* tipc/node: Fix socket fd check in cmd_node_get_addr()Phil Sutter2017-08-181-1/+2
| | | | | | socket() returns -1 on error, not 0. Signed-off-by: Phil Sutter <phil@nwl.cc>
* tipc: cleanup style issuesStephen Hemminger2016-09-201-26/+42
| | | | Fix style issues reported by checkpatch.
* tipc: add link monitor listParthasarathy Bhuvaragan2016-09-201-0/+237
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In this commit, we list the monitor attributes. By default it lists the attributes for all bearers, otherwise the specified bearer. A sample usage is shown below: $ tipc link monitor list bearer eth:data0 node status monitored generation applied_node_status [non_applied_node:status] 1.1.1 up direct 16 UU [] 1.1.2 up direct 16 UU [] 1.1.3 up direct 16 UU [] bearer eth:data1 node status monitored generation applied_node_status [non_applied_node:status] 1.1.1 up direct 2 UU [] 1.1.2 up direct 3 UU [] 1.1.3 up direct 3 UU [] $ tipc link monitor list media eth device data0 bearer eth:data0 node status monitored generation applied_node_status [non_applied_node:status] 1.1.1 up direct 16 UU [] 1.1.2 up direct 16 UU [] 1.1.3 up direct 16 UU [] $ tipc link monitor list -h Usage: tipc monitor list [ media MEDIA ARGS...] MEDIA udp - User Datagram Protocol ib - Infiniband eth - Ethernet Acked-by: Jon Maloy <jon.maloy@ericsson.com> Tested-by: Jon Maloy <jon.maloy@ericsson.com> Signed-off-by: Parthasarathy Bhuvaragan <parthasarathy.bhuvaragan@ericsson.com>
* tipc: refractor bearer to facilitate link monitorParthasarathy Bhuvaragan2016-09-202-31/+48
| | | | | | | | | | | | In this commit, we: 1. Export print_bearer_media() 2. Move the bearer name handling from nl_add_bearer_name() into a new function cmd_get_unique_bearer_name(). These exported functions will be used by link monitor used in subsequent commits. Signed-off-by: Parthasarathy Bhuvaragan <parthasarathy.bhuvaragan@ericsson.com>
* tipc: add link monitor summaryParthasarathy Bhuvaragan2016-09-201-1/+46
| | | | | | | | | | | | | | | | | | | | | | | The monitor summary command prints the basic attributes specific to the local node. A sample usage is shown below: $ tipc link monitor summary bearer eth:data0 table_generation 15 cluster_size 8 algorithm overlapping-ring bearer eth:data1 table_generation 15 cluster_size 8 algorithm overlapping-ring $ tipc link monitor summary -h Usage: tipc monitor summary Acked-by: Jon Maloy <jon.maloy@ericsson.com> Tested-by: Jon Maloy <jon.maloy@ericsson.com> Signed-off-by: Parthasarathy Bhuvaragan <parthasarathy.bhuvaragan@ericsson.com>
* tipc: add link monitor get thresholdParthasarathy Bhuvaragan2016-09-201-1/+55
| | | | | | | | | | | | | | | | | The command prints the monitor activation threshold. A sample usage is shown below: $ tipc link monitor get threshold 32 $ tipc link monitor get -h Usage: tipc monitor get PPROPERTY PROPERTIES threshold - Get monitor activation threshold Acked-by: Jon Maloy <jon.maloy@ericsson.com> Tested-by: Jon Maloy <jon.maloy@ericsson.com> Signed-off-by: Parthasarathy Bhuvaragan <parthasarathy.bhuvaragan@ericsson.com>
* tipc: add link monitor set thresholdParthasarathy Bhuvaragan2016-09-201-1/+68
| | | | | | | | | | | | | | | | | The command sets the activation threshold for the new cluster ring supervision. A sample usage is shown below: $ tipc link monitor set threshold 4 $ tipc link monitor set -h Usage: tipc monitor set PPROPERTY PROPERTIES threshold SIZE - Set activation threshold for monitor Acked-by: Jon Maloy <jon.maloy@ericsson.com> Tested-by: Jon Maloy <jon.maloy@ericsson.com> Signed-off-by: Parthasarathy Bhuvaragan <parthasarathy.bhuvaragan@ericsson.com>
* tipc: remove dead codeParthasarathy Bhuvaragan2016-09-201-3/+0
| | | | | | remove dead code and a newline. Signed-off-by: Parthasarathy Bhuvaragan <parthasarathy.bhuvaragan@ericsson.com>
* tipc: add the ability to get UDP bearer optionsRichard Alpe2016-09-015-38/+268
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In this patch we introduce the ability to get UDP specific bearer options such as remoteip, remoteport, localip and localport. After some discussions on tipc-discussion on how to handle media specific options we agreed to pass them after the media. For media generic bearer options we already do: $ tipc bearer get OPTION media MEDIA name|device NAME|DEVICE For the UDP media specific bearer options we introduce in this path: $ tipc bearer get media udp name NAME OPTION such as $ tipc bearer get media udp name NAME remoteip This allows bash-completion to tab complete only appropriate options, it makes more logical sense and it scales better. Even though it might look a little different to the user. In order to use the existing option parsing framework to do this we add a flag (OPT_KEY) to the option parsing function. If the UDP bearer has multiple remoteip addresses associated with it (replicast) we handle the TIPC_NLA_UDP_MULTI_REMOTEIP flag and send a TIPC_NL_UDP_GET_REMOTEIP query transparently to the user. Signed-off-by: Richard Alpe <richard.alpe@ericsson.com> Reviewed-by: Parthasarathy Bhuvaragan <parthasarathy.bhuvaragan@ericsson.com> Acked-by: Jon Maloy <jon.maloy@ericsson.com>