summaryrefslogtreecommitdiff
path: root/src/ipcpd
Commit message (Collapse)AuthorAgeFilesLines
...
* ipcpd: Merge dt_pci into dt sourceDimitri Staessens2018-10-026-192/+91
| | | | | | | | This merges the dt_pci code into the dt source. It simplifies the code base, and allows inline compilation. Removes unnecessary includes. Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be> Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
* ipcpd: Add return value checks to UDP IPCPSander Vrijders2018-09-271-17/+37
| | | | | | | Some return value checks were missing in the UDP IPCP. Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be> Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be>
* ipcpd: Fix test of routing table calculationSander Vrijders2018-09-271-4/+4
| | | | | | | | | A previous commit changes the signature of the function that calculates the routing table. The test was not changed accordingly, making make check fail. Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be> Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be>
* ipcpd: Remove double close in Ethernet IPCPSander Vrijders2018-09-271-2/+1
| | | | | | | | | There was a double close of a fd in the Ethernet IPCP. It also passes the correct max length to a memcpy (a strlen of the source string was used previously). Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be> Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be>
* include: Remove _DEFAULT_SOURCE in endian.hDimitri Staessens2018-09-2716-0/+62
| | | | | | | | This removes the _DEFAULT_SOURCE definition in the endian header as it should not be there. This avoids double and conflicting definitions. Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be> Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
* ipcpd: Simplify routing algorithm selectionSander Vrijders2018-09-143-89/+85
| | | | | | | | | | Previously there was a separate function per routing algorithm selection, when in fact the algorithms all take as input a graph and output a routing table, making it possible to place them in a single function. Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be> Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be>
* ipcpd: Check if mgmt flow event is FLOW_PKT0.11.12Sander Vrijders2018-07-271-1/+4
| | | | | | | | | The management flows were considering every event to be a FLOW_PKT event, when in fact it could also be a flow down or up event, resulting in indefinite reads. Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be> Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be>
* ipcpd: Fix sequence number check for link state0.11.11Sander Vrijders2018-07-251-11/+11
| | | | | | | | | Commit a3903da659e introduced sequence number for the LSAs to make it more robust, but the check was not done properly, and the seqno was always changed regardless of whether it was an old LSA or not. Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be> Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be>
* ipcpd: Only forward new LSAs of the LSDBSander Vrijders2018-07-151-17/+36
| | | | | | | | | | | | This will add a sequence number to the Link State Advertisements so that upon receiving a LSA we can check if we need to forward the LSA or not. If we already have the LSA with the received seqno in the LSDB we do not forward it. This allows for setting up a management network that has loops since the spanning tree upon which the LSAs are sent is pruned on every hop. Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be> Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be>
* ipcpd: React to flow events activelySander Vrijders2018-07-043-15/+38
| | | | | | | | This adds the infrastructure to actively react to flow up, down and deallocated events. Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be> Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be>
* ipcpd: Recalculate PFF only if LSDB changedSander Vrijders2018-06-191-18/+50
| | | | | | | | | This will add a flag so the PFF is only recalculated if the LSDB has changed. It also removes the instant recalculation of the LSDB if a new neighbor is added, since this might cause instabilities. Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be> Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be>
* ipcpd: Change connection down to flow downSander Vrijders2018-06-196-6/+67
| | | | | | | | | | The DT component was flagging a connection as down and passing the fd that was down. Of course the other components expect a connection instead of just a fd. Now the connection manager will listen to flow up and down events, and flag the connection up or down if needed. Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be> Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be>
* Merge branch 'testing' into beSander Vrijders2018-06-151-2/+3
|\
| * ipcpd: Fix RIB output for dt componentDimitri Staessens2018-06-151-2/+3
| | | | | | | | | | | | | | | | The RIB output length was fixed for 3 qos cubes. Now it will scale correctly if QoS cubes are added or removed. Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be> Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
* | Merge branch 'testing' into beSander Vrijders2018-06-133-22/+30
|\|
| * lib: Use macros for all time utility functions0.11.9Dimitri Staessens2018-06-132-0/+2
| | | | | | | | | | | | | | | | | | This replaces the time utility functions with macros. This avoids using library functions in the tools and also slightly speeds up the implementation. Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be> Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
| * ipcpd: Get mtu using ioctl before hw addressDimitri Staessens2018-06-131-6/+6
| | | | | | | | | | | | | | | | | | The SIOCGIFMTU command uses the ifr struct, which is a union, so it can't store the hw address and the MTU at the same time. We now call SIOCGIFMTU and set the MTU before SIOCGIFHWADDR. Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be> Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
| * ipcpd: Fix MTU handling in ethDimitri Staessens2018-06-131-16/+22
| | | | | | | | | | | | | | | | This fixes the MTU handling in eth. Buffers are now allocated to smaller size. Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be> Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
* | Merge branch 'testing' into beSander Vrijders2018-06-082-1/+16
|\|
| * ipcpd: Limit eth MTU to rdrb in single-block modeDimitri Staessens2018-06-082-1/+16
| | | | | | | | | | | | | | | | | | When the SHM is in single block mode, the MTU may be bigger than a block. The eth IPCPs reserved buffers the size of MTU, which is now limited. Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be> Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
* | ipcpd: Support data QoS cube in UDP shimSander Vrijders2018-06-081-1/+1
| | | | | | | | | | | | | | | | This will also allow flows with the data QoS cube to be allocated over the UDP shim. Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be> Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be>
* | lib: Add a data qos cubeDimitri Staessens2018-06-084-2/+10
|/ | | | | | | | This adds a data qos cube that is reliable. Reliable qos can be selected by setting the loss parameter of the qosspec to 0. Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be> Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
* ipcpd: Support raw qos in eth and udp IPCPsDimitri Staessens2018-06-082-2/+2
| | | | | | | | Flow allocation for raw was not yet supported in these IPCPS, causing enrollment to fail. Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be> Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
* ipcpd: Add priority for raw flowsDimitri Staessens2018-06-073-0/+8
| | | | | | | | The raw flows had no priority assigned, causing the scheduler to fail on creation. Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be> Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
* build: Fix running make check standaloneSander Vrijders2018-05-301-2/+2
| | | | | | | | | In the current build an error would happen if a user simply runs make check after running cmake, since the kademlia protocol buffer file was not generated yet. This simply regenerates the file for the test. Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be> Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be>
* ipcpd: Include string for memset in graph.c0.11.8Dimitri Staessens2018-05-291-0/+1
| | | | | | | | The memset function was used without including <string.h>, which some compilers complain about. Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be> Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
* build: Update default values0.11.7Sander Vrijders2018-05-292-2/+2
| | | | | | | | | | | This sets updated default values for the default build. A higher connect timeout until we have asynchronous local IPC. Disabled SWIG since the lastest gcc reports an error. IPCP flow stats enabled by default since their impact on the performance is very limited. Waiting for the directory to enroll before returning to increase stability. Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be> Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be>
* ipcpd: Add address to DT directory name in RIBDimitri Staessens2018-05-291-1/+3
| | | | | | | This adds the address to the DT directory name in the RIB. Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be> Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
* ipcpd: Avoid false positive use-after-free in DHTDimitri Staessens2018-05-281-0/+1
| | | | | | | | | The static analyzer misses the linked list logic. An assertion is added that indicates that the pointer was changed indirectly by the previous element. Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be> Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
* build: Check for variable length arraysDimitri Staessens2018-05-282-24/+57
| | | | | | | | | | The clang and gcc compilers don't complain about variable length arrays using the -c89 flag unless the flag -Wvla or -Wpedantic is set. This also fixes a memleak and two false positive uninitialized variable warnings reported by the clang static analyzer in graph.c. Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be> Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
* ipcpd: Use eid in fa protocol instead of fdDimitri Staessens2018-05-271-14/+14
| | | | | | | | | The flow allocator protocol used fd in the message exchange since eids were directly mapped to fds. It's better to name them eid in the protocol to avoid confusion. Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be> Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
* ipcpd: Fix memleak in DHTDimitri Staessens2018-05-271-9/+5
| | | | | | | | | | This fixes a memleak for the info struct when join thread creation is not needed. Fixes a false positive warning when running the clang static analyzer. Removes a use-after-free warning that is not valid since 0.11.4. Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be> Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
* ipcpd: Fix false positive incompatible malloc typeDimitri Staessens2018-05-271-6/+4
| | | | | | | | | A malloc was performed with a mgmt_msg type and converted to a uint8_t buffer for serialization, which triggers a false positive warning with the clang static analyzer. Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be> Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
* lib: Use IPCP name as RIB directoryDimitri Staessens2018-05-151-1/+1
| | | | | | | | This will change the FUSE mountpount to the name of the IPCP instead of a generic name based on its pid. Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be> Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
* ipcpd: Fix check build for DHT0.11.6Dimitri Staessens2018-05-081-0/+4
| | | | | | | | The DHT test failed on the use of IPCP-specific calls. These calls are now guarded by the correct defition checks. Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be> Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
* ipcpd: Include ipcp-dev header in DHT0.11.5Dimitri Staessens2018-05-081-1/+1
| | | | | | | | The DHT called ipcp_sdb_release without including ipcp-dev, causing compiler errors on some machines. Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be> Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
* ipcpd: Fix setting MTU for eth-llcDimitri Staessens2018-05-081-3/+12
| | | | | | | | The MTU was not correctly set for the eth-llc ipcp. This also fixes a missing definition of ETH_MAX_MTU, which was introduced in kernel v4.10. Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be> Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
* ipcpd: Fix parameter in debug logDimitri Staessens2018-05-081-2/+2
| | | | | | | | The cpu was a size_t but printed as an unsigned long, giving compilation errors on 32 bit machines. Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be> Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
* ipcpd: Use correct MTU for eth-dixDimitri Staessens2018-05-071-4/+24
| | | | | | | | The eth-dix IPCP was using a hardcoded MTU of 1500 bytes, but could support higher MTUs. Now jumbo frames are supported. Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be> Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
* ipcpd: Fix bad memory handling in LFA policySander Vrijders2018-05-042-7/+8
| | | | | | | | | | | | | The Loop-Free Alternates policy had bad memory management in two places. In the calculation of the LFAs a table was freed in the first iteration of a loop, whereas it was still needed in the other iterations. It is now freed outside of the loop. In the alternate PFF the address structs were not freed upon shutdown, this has been added as well. It also fixes some bad initialization in the LFA calculation function. Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be> Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be>
* ipcpd: Limit number of returned query addresses0.11.4Dimitri Staessens2018-05-031-12/+18
| | | | | | | | | The query returned all addresses where a name was registered, causing some scaling problems. Now it will return at most DHT_RETR_ADDR, which is currently set at 1 (anycast). Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be> Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
* ipcpd: Allow wait for dir enrollment on dt connDimitri Staessens2018-05-037-2/+24
| | | | | | | | | This adds the option to wait for the directory (DHT) to enroll on creating a new data transfer connection. This makes scripting network bootstraps more stable. The default setting is OFF. Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be> Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
* ipcpd: Recalculate PFF upon adding new neighborSander Vrijders2018-05-031-31/+42
| | | | | | | | | | This recalculates the PFF upon adding a new neighbor, so that the network reconverges faster. It is safe to do so since it is only done by the two IPCPs that established the new flow. The PFF is also recalculated every 4 seconds. Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be> Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be>
* ipcpd: Prevent parallel DHT enrollment threadsDimitri Staessens2018-05-031-22/+24
| | | | | | | | | This will prevent quick calls to ipcp conn for dt flows to create multiple join threads in parallel, instead the subsequent calls will wait for the pending join to finish. Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be> Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
* lib: Make UNIX socket buffer size configurable0.11.3Sander Vrijders2018-05-031-2/+2
| | | | | | | | | | This makes the buffer size used by the UNIX sockets configurable. In case of a lot of IPCPs in the system it might become too small with the default value, resulting in irm command failures. The user can now easily configure it with an adequate value. Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be> Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be>
* ipcpd: Don't do lookup with new DT when runningDimitri Staessens2018-05-031-4/+8
| | | | | | | | | | The DHT performed a lookup upon a new DT connection when it was running for efficiency reasons. This lookup somehow cause SEGV under stress (rapid bootstrapping of networks). This will be solved with a full revision of the DHT implementation. Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be> Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
* ipcpd: Cleanup pending DHT commands on shutdownDimitri Staessens2018-05-031-0/+7
| | | | | | | The list of commands was not cleaned up on shutdown. Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be> Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
* ipcpd: Remove cookie from DHT lookup at updateDimitri Staessens2018-05-031-1/+4
| | | | | | | | | | The lookup struct uses the cookies to track pending request messages, but they were not removed when a response is processed. Upon reuse of a cookie for the next message, it could update the wrong lookup. This removes the cookie for a lookup when it is looked for. Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be> Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
* ipcpd: Shut down DHT gracefully during enrollmentDimitri Staessens2018-05-031-0/+10
| | | | | | | | | The DHT has a thread that continued to run during shutdown. The shutdown state is now checked for. It will not try to send messages at shutdown. Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be> Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
* ipcpd: Create notifier before connmgrDimitri Staessens2018-04-261-9/+9
| | | | | | | | The connmgr requires the notifier, but the notifier was created after and destroyed before the connmgr. This is now fixed. Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be> Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>