- IPC socket: add REUSEADDR when using IP (remove comment)
- Test: remove variable to use backend restconf, since that is the only option - Docs C-style: describe return values better
This commit is contained in:
parent
6e0e45aab7
commit
9fce0a1214
3 changed files with 8 additions and 9 deletions
|
|
@ -89,6 +89,7 @@ config_socket_init_ipv4(clicon_handle h,
|
||||||
int s;
|
int s;
|
||||||
struct sockaddr_in addr;
|
struct sockaddr_in addr;
|
||||||
uint16_t port;
|
uint16_t port;
|
||||||
|
int one = 1;
|
||||||
|
|
||||||
port = clicon_sock_port(h);
|
port = clicon_sock_port(h);
|
||||||
|
|
||||||
|
|
@ -97,7 +98,7 @@ config_socket_init_ipv4(clicon_handle h,
|
||||||
clicon_err(OE_UNIX, errno, "socket");
|
clicon_err(OE_UNIX, errno, "socket");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
// setsockopt(s, SOL_SOCKET, SO_REUSEADDR, (void*)&one, sizeof(one));
|
setsockopt(s, SOL_SOCKET, SO_REUSEADDR, (void*)&one, sizeof(one));
|
||||||
memset(&addr, 0, sizeof(addr));
|
memset(&addr, 0, sizeof(addr));
|
||||||
addr.sin_family = AF_INET;
|
addr.sin_family = AF_INET;
|
||||||
addr.sin_port = htons(port);
|
addr.sin_port = htons(port);
|
||||||
|
|
|
||||||
|
|
@ -74,13 +74,13 @@ Errors are typically declared as follows:
|
||||||
All function returns that have return values must be checked
|
All function returns that have return values must be checked
|
||||||
|
|
||||||
Default return values form a function are:
|
Default return values form a function are:
|
||||||
0: OK
|
- `0` OK
|
||||||
-1: Fatal Error
|
- `-1` Fatal Error
|
||||||
|
|
||||||
In some cases, Clixon uses three-value returns as follows:
|
In some cases, Clixon uses three-value returns as follows:
|
||||||
1: OK
|
- `1` OK
|
||||||
0: Invalid
|
- `0` Invalid
|
||||||
-1: Fatal error
|
- `-1` Fatal error
|
||||||
|
|
||||||
### Return values
|
### Return values
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -51,11 +51,9 @@ if [ "${WITH_RESTCONF}" = "native" ]; then
|
||||||
# Create server certs and CA
|
# Create server certs and CA
|
||||||
cacerts $cakey $cacert
|
cacerts $cakey $cacert
|
||||||
servercerts $cakey $cacert $srvkey $srvcert
|
servercerts $cakey $cacert $srvkey $srvcert
|
||||||
USEBACKEND=false
|
|
||||||
else
|
else
|
||||||
# Define default restconfig config: RESTCONFIG
|
# Define default restconfig config: RESTCONFIG
|
||||||
RESTCONFIG=$(restconf_config none false)
|
RESTCONFIG=$(restconf_config none false)
|
||||||
USEBACKEND=false
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# This is a fixed 'state' implemented in routing_backend. It is assumed to be always there
|
# This is a fixed 'state' implemented in routing_backend. It is assumed to be always there
|
||||||
|
|
@ -113,7 +111,7 @@ cat <<EOF > $cfg
|
||||||
<CLICON_BACKEND_PIDFILE>/usr/local/var/$APPNAME/$APPNAME.pidfile</CLICON_BACKEND_PIDFILE>
|
<CLICON_BACKEND_PIDFILE>/usr/local/var/$APPNAME/$APPNAME.pidfile</CLICON_BACKEND_PIDFILE>
|
||||||
<CLICON_XMLDB_DIR>/usr/local/var/$APPNAME</CLICON_XMLDB_DIR>
|
<CLICON_XMLDB_DIR>/usr/local/var/$APPNAME</CLICON_XMLDB_DIR>
|
||||||
<CLICON_MODULE_LIBRARY_RFC7895>true</CLICON_MODULE_LIBRARY_RFC7895>
|
<CLICON_MODULE_LIBRARY_RFC7895>true</CLICON_MODULE_LIBRARY_RFC7895>
|
||||||
<CLICON_BACKEND_RESTCONF_PROCESS>$USEBACKEND</CLICON_BACKEND_RESTCONF_PROCESS>
|
<CLICON_BACKEND_RESTCONF_PROCESS>false</CLICON_BACKEND_RESTCONF_PROCESS>
|
||||||
$RESTCONFIG <!-- only fcgi -->
|
$RESTCONFIG <!-- only fcgi -->
|
||||||
</clixon-config>
|
</clixon-config>
|
||||||
EOF
|
EOF
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue