diff options
author | Sander Vrijders <sander.vrijders@ugent.be> | 2018-10-03 12:16:44 +0200 |
---|---|---|
committer | Dimitri Staessens <dimitri.staessens@ugent.be> | 2018-10-03 15:18:24 +0200 |
commit | 4b88be0201a947491130f174552a86a50c233dc2 (patch) | |
tree | 1c14b636a6bcf7cc43d0a1839d8a4ac9592e48bc /src/ipcpd/eth/eth.c | |
parent | a789531e1dab39fcddc6d57af2312ead3b1fa4cc (diff) | |
download | ouroboros-4b88be0201a947491130f174552a86a50c233dc2.tar.gz ouroboros-4b88be0201a947491130f174552a86a50c233dc2.zip |
ipcpd: Bypass Qdisc in Ethernet IPCP
Since Linux kernel 3.14 there is the option to bypass the kernel
Qdisc. This will speed up the Ethernet IPCP.
Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be>
Diffstat (limited to 'src/ipcpd/eth/eth.c')
-rw-r--r-- | src/ipcpd/eth/eth.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/ipcpd/eth/eth.c b/src/ipcpd/eth/eth.c index 8175d803..05dd9ac7 100644 --- a/src/ipcpd/eth/eth.c +++ b/src/ipcpd/eth/eth.c @@ -1200,6 +1200,9 @@ static int eth_ipcp_bootstrap(const struct ipcp_config * conf) #ifndef SHM_RDRB_MULTI_BLOCK size_t maxsz; #endif +#if defined(HAVE_RAW_SOCKETS) + int qdisc_bypass = 1; +#endif assert(conf); assert(conf->type == THIS_TYPE); @@ -1365,6 +1368,11 @@ static int eth_ipcp_bootstrap(const struct ipcp_config * conf) return -1; } + if (setsockopt(eth_data.s_fd, SOL_PACKET, PACKET_QDISC_BYPASS, + &qdisc_bypass, sizeof(qdisc_bypass))) { + log_info("Qdisc bypass not supported."); + } + if (bind(eth_data.s_fd, (struct sockaddr *) ð_data.device, sizeof(eth_data.device))) { log_err("Failed to bind socket to interface"); |