mirror of
https://github.com/servalproject/serval-dna.git
synced 2025-02-22 02:06:42 +00:00
changed client sockets to use PID instead of random 32bit number.
Means that bindings can be reused more easily, and directory doesn't fill up with stale sockets so easily.
This commit is contained in:
parent
e38854d4c0
commit
900bfab1e9
@ -1121,10 +1121,10 @@ int overlay_mdp_client_init()
|
||||
name.sun_family = AF_UNIX;
|
||||
if (overlay_mdp_client_socket_path_len==-1) {
|
||||
char fmt[1024];
|
||||
if (!FORM_SERVAL_INSTANCE_PATH(fmt, "mdp-client-%08x.socket"))
|
||||
if (!FORM_SERVAL_INSTANCE_PATH(fmt, "mdp-client-%d.socket"))
|
||||
return WHY("Could not form MDP client socket name");
|
||||
snprintf(overlay_mdp_client_socket_path,1024,fmt,random_value);
|
||||
overlay_mdp_client_socket_path_len=strlen(overlay_mdp_client_socket_path);
|
||||
snprintf(overlay_mdp_client_socket_path,1024,fmt,getpid());
|
||||
overlay_mdp_client_socket_path_len=strlen(overlay_mdp_client_socket_path)+1;
|
||||
WHYF("MDP client socket name='%s'",overlay_mdp_client_socket_path);
|
||||
}
|
||||
bcopy(overlay_mdp_client_socket_path,name.sun_path,
|
||||
|
Loading…
x
Reference in New Issue
Block a user