summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSander Vrijders <sander.vrijders@ugent.be>2018-10-12 17:44:36 +0200
committerSander Vrijders <sander.vrijders@ugent.be>2018-10-12 17:44:36 +0200
commit36b89517affd96c9e323af9a4e6e88c8f0938caf (patch)
tree4a1f9ffc324c37bef728e1610a2fb91e78ae6122 /src
parent1ee129f4479b1910afc929f24bb70b8bc6478f01 (diff)
parent3a650d07d2d7540ebee65cef58b35f0373ad14d6 (diff)
downloadouroboros-36b89517affd96c9e323af9a4e6e88c8f0938caf.tar.gz
ouroboros-36b89517affd96c9e323af9a4e6e88c8f0938caf.zip
Merge branch 'testing' into be
Diffstat (limited to 'src')
-rw-r--r--src/ipcpd/CMakeLists.txt7
-rw-r--r--src/ipcpd/config.h.in2
-rw-r--r--src/ipcpd/eth/CMakeLists.txt2
-rw-r--r--src/ipcpd/eth/eth.c4
-rw-r--r--src/ipcpd/normal/dht.c2
-rw-r--r--src/ipcpd/normal/pol/link_state.c9
-rw-r--r--src/irmd/main.c4
-rw-r--r--src/lib/irm.c4
8 files changed, 24 insertions, 10 deletions
diff --git a/src/ipcpd/CMakeLists.txt b/src/ipcpd/CMakeLists.txt
index 50d23f8e..3fa3bb0f 100644
--- a/src/ipcpd/CMakeLists.txt
+++ b/src/ipcpd/CMakeLists.txt
@@ -16,6 +16,8 @@ set(DISABLE_CORE_LOCK FALSE CACHE BOOL
"Disable locking performance threads to a core")
set(IPCP_CONN_WAIT_DIR TRUE CACHE BOOL
"Check the running state of the directory when adding a dt connection")
+set(DHT_ENROLL_SLACK 50 CACHE STRING
+ "DHT enrollment waiting time (0-999, ms)")
if ((IPCP_QOS_CUBE_BE_PRIO LESS 0) OR (IPCP_QOS_CUBE_BE_PRIO GREATER 99))
message(FATAL_ERROR "Invalid priority for best effort QoS cube")
@@ -29,6 +31,11 @@ if ((IPCP_QOS_CUBE_VOICE_PRIO LESS 0) OR (IPCP_QOS_CUBE_VOICE_PRIO GREATER 99))
message(FATAL_ERROR "Invalid priority for voice QoS cube")
endif ()
+if ((DHT_ENROLL_SLACK LESS 0) OR (DHT_ENROLL_SLACK GREATER 999))
+ message(FATAL_ERROR "Invalid DHT slack value")
+endif ()
+
+
set(IPCP_SOURCES
# Add source files here
${CMAKE_CURRENT_SOURCE_DIR}/ipcp.c
diff --git a/src/ipcpd/config.h.in b/src/ipcpd/config.h.in
index 567fe971..f7af0808 100644
--- a/src/ipcpd/config.h.in
+++ b/src/ipcpd/config.h.in
@@ -47,6 +47,7 @@
#define QOS_PRIO_VOICE @IPCP_QOS_CUBE_VOICE_PRIO@
#define IPCP_SCHED_THR_MUL @IPCP_SCHED_THR_MUL@
#define PFT_SIZE @PFT_SIZE@
+#define DHT_ENROLL_SLACK @DHT_ENROLL_SLACK@
#cmakedefine IPCP_CONN_WAIT_DIR
#cmakedefine DISABLE_CORE_LOCK
@@ -63,3 +64,4 @@
#cmakedefine HAVE_RAW_SOCKETS
#define IPCP_ETH_RD_THR @IPCP_ETH_RD_THR@
#define IPCP_ETH_WR_THR @IPCP_ETH_WR_THR@
+#cmakedefine IPCP_ETH_QDISC_BYPASS
diff --git a/src/ipcpd/eth/CMakeLists.txt b/src/ipcpd/eth/CMakeLists.txt
index 6672f93c..e4acdb7f 100644
--- a/src/ipcpd/eth/CMakeLists.txt
+++ b/src/ipcpd/eth/CMakeLists.txt
@@ -82,6 +82,8 @@ if (HAVE_ETH)
"Number of reader threads in Ethernet IPCP")
set(IPCP_ETH_WR_THR 3 CACHE STRING
"Number of writer threads in Ethernet IPCP")
+ set(IPCP_ETH_QDISC_BYPASS false CACHE BOOL
+ "Bypass the Qdisc in the kernel when using raw sockets")
set(ETH_LLC_SOURCES
# Add source files here
diff --git a/src/ipcpd/eth/eth.c b/src/ipcpd/eth/eth.c
index e7a1580c..3a749cf7 100644
--- a/src/ipcpd/eth/eth.c
+++ b/src/ipcpd/eth/eth.c
@@ -1231,7 +1231,9 @@ static int eth_ipcp_bootstrap(const struct ipcp_config * conf)
size_t maxsz;
#endif
#if defined(HAVE_RAW_SOCKETS)
+ #if defined(IPCP_ETH_QDISC_BYPASS)
int qdisc_bypass = 1;
+ #endif /* ENABLE_QDISC_BYPASS */
int flags;
#endif
assert(conf);
@@ -1415,10 +1417,12 @@ static int eth_ipcp_bootstrap(const struct ipcp_config * conf)
goto fail_device;
}
+ #if defined(IPCP_ETH_QDISC_BYPASS)
if (setsockopt(eth_data.s_fd, SOL_PACKET, PACKET_QDISC_BYPASS,
&qdisc_bypass, sizeof(qdisc_bypass))) {
log_info("Qdisc bypass not supported.");
}
+ #endif
if (bind(eth_data.s_fd, (struct sockaddr *) &eth_data.device,
sizeof(eth_data.device))) {
diff --git a/src/ipcpd/normal/dht.c b/src/ipcpd/normal/dht.c
index aa1909e9..0ad9d9a7 100644
--- a/src/ipcpd/normal/dht.c
+++ b/src/ipcpd/normal/dht.c
@@ -2729,7 +2729,7 @@ static void handle_event(void * self,
pthread_t thr;
struct join_info * inf;
struct conn * c = (struct conn *) o;
- struct timespec slack = {0, 10 * MILLION};
+ struct timespec slack = {0, DHT_ENROLL_SLACK * MILLION};
/* Give the pff some time to update for the new link. */
nanosleep(&slack, NULL);
diff --git a/src/ipcpd/normal/pol/link_state.c b/src/ipcpd/normal/pol/link_state.c
index e8677f0d..5f592edf 100644
--- a/src/ipcpd/normal/pol/link_state.c
+++ b/src/ipcpd/normal/pol/link_state.c
@@ -789,16 +789,15 @@ static void handle_event(void * self,
switch (event) {
case NOTIFY_DT_CONN_ADD:
+ pthread_rwlock_rdlock(&ls.db_lock);
+ send_lsm(ipcpi.dt_addr, c->conn_info.addr, 0);
+ pthread_rwlock_unlock(&ls.db_lock);
+
if (lsdb_add_nb(c->conn_info.addr, c->flow_info.fd, NB_DT))
log_dbg("Failed to add neighbor to LSDB.");
if (lsdb_add_link(ipcpi.dt_addr, c->conn_info.addr, 0, &qs))
log_dbg("Failed to add new adjacency to LSDB.");
-
- pthread_rwlock_rdlock(&ls.db_lock);
- send_lsm(ipcpi.dt_addr, c->conn_info.addr, 0);
- pthread_rwlock_unlock(&ls.db_lock);
-
break;
case NOTIFY_DT_CONN_DEL:
flow_event(c->flow_info.fd, false);
diff --git a/src/irmd/main.c b/src/irmd/main.c
index 78fcf7b5..d3f7a09e 100644
--- a/src/irmd/main.c
+++ b/src/irmd/main.c
@@ -2041,10 +2041,8 @@ static void * mainloop(void * o)
pthread_cleanup_pop(true);
pthread_cleanup_pop(false);
- if (result == -EPIPE) {
- log_warn("Peer closed socket.");
+ if (result == -EPIPE)
goto fail;
- }
ret_msg->has_result = true;
ret_msg->result = result;
diff --git a/src/lib/irm.c b/src/lib/irm.c
index d88475c4..384da7b0 100644
--- a/src/lib/irm.c
+++ b/src/lib/irm.c
@@ -117,6 +117,9 @@ int irm_bootstrap_ipcp(pid_t pid,
config.ipcp_type = conf->type;
+ if (conf->type != IPCP_UDP)
+ layer_info.dir_hash_algo = conf->layer_info.dir_hash_algo;
+
switch (conf->type) {
case IPCP_NORMAL:
config.has_addr_size = true;
@@ -131,7 +134,6 @@ int irm_bootstrap_ipcp(pid_t pid,
config.routing_type = conf->routing_type;
config.has_pff_type = true;
config.pff_type = conf->pff_type;
- layer_info.dir_hash_algo = conf->layer_info.dir_hash_algo;
break;
case IPCP_UDP:
config.has_ip_addr = true;