diff options
author | dimitri staessens <dimitri.staessens@intec.ugent.be> | 2016-04-27 18:36:31 +0200 |
---|---|---|
committer | dimitri staessens <dimitri.staessens@intec.ugent.be> | 2016-04-27 18:36:31 +0200 |
commit | 1a02682d0695509bb8255b2d10dee48c61d83c34 (patch) | |
tree | 02f9df75cdb4142a843d04c8727e917c77c20f7d /src/ipcpd/shim-udp/main.c | |
parent | 711789580dc6ee3a1a22b8fee63f5eff7e7dbb5e (diff) | |
download | ouroboros-1a02682d0695509bb8255b2d10dee48c61d83c34.tar.gz ouroboros-1a02682d0695509bb8255b2d10dee48c61d83c34.zip |
lib: client-side flow allocation
flow allocation now propagates on the client side up to the IPCP.
added UNKNOWN_AP and UNKNOWN_AE definitions to dev.h
Diffstat (limited to 'src/ipcpd/shim-udp/main.c')
-rw-r--r-- | src/ipcpd/shim-udp/main.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/ipcpd/shim-udp/main.c b/src/ipcpd/shim-udp/main.c index c07d77c2..71c414ef 100644 --- a/src/ipcpd/shim-udp/main.c +++ b/src/ipcpd/shim-udp/main.c @@ -29,6 +29,7 @@ #include <ouroboros/ipcp.h> #include <ouroboros/dif_config.h> #include <ouroboros/sockets.h> +#include <ouroboros/dev.h> #define OUROBOROS_PREFIX "ipcpd/shim-udp" @@ -192,7 +193,7 @@ static void * ipcp_udp_listener() /* reply to IRM */ flow->flow.port_id = ipcp_flow_req_arr(getpid(), buf, - ANONYMOUS_AP, ""); + UNKNOWN_AP, ""); if (flow->flow.port_id < 0) { LOG_ERR("Could not get port id from IRMd"); close(flow->fd); @@ -270,6 +271,7 @@ int ipcp_udp_bootstrap(struct dif_config * conf) char dnsstr[INET_ADDRSTRLEN]; pthread_t handler; pthread_t sdu_reader; + int enable = 1; if (conf->type != THIS_TYPE) { LOG_ERR("Config doesn't match IPCP type."); @@ -305,6 +307,14 @@ int ipcp_udp_bootstrap(struct dif_config * conf) return -1; } + if (setsockopt(shim_data(_ipcp)->s_fd, + SOL_SOCKET, + SO_REUSEADDR, + &enable, + sizeof(int)) < 0) { + LOG_DBGF("Setsockopt(SO_REUSEADDR) failed."); + } + shim_data(_ipcp)->s_saddr.sin_family = AF_INET; shim_data(_ipcp)->s_saddr.sin_addr.s_addr = conf->ip_addr; shim_data(_ipcp)->s_saddr.sin_port = LISTEN_PORT; @@ -419,6 +429,7 @@ int ipcp_udp_flow_alloc(uint32_t port_id, h = gethostbyname(dst_name); if (h == NULL) { + LOG_DBGF("Could not resolve %s.", dst_name); close(flow->fd); free(flow); return -1; |