~mdw
/
tripe
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
New peer option `-mobile': follow rapid IP address and port changes.
[tripe]
/
server
/
admin.c
diff --git
a/server/admin.c
b/server/admin.c
index
32b3577
..
7fa3f0f
100644
(file)
--- a/
server/admin.c
+++ b/
server/admin.c
@@
-1232,7
+1232,7
@@
static void acmd_add(admin *a, unsigned ac, char *av[])
add->peer.tag = 0;
add->peer.t_ka = 0;
add->peer.tops = tun_default;
add->peer.tag = 0;
add->peer.t_ka = 0;
add->peer.tops = tun_default;
- add->peer.
kx
f = 0;
+ add->peer.f = 0;
/* --- Parse options --- */
/* --- Parse options --- */
@@
-1252,12
+1252,13
@@
static void acmd_add(admin *a, unsigned ac, char *av[])
}
})
OPTTIME("-keepalive", t, { add->peer.t_ka = t; })
}
})
OPTTIME("-keepalive", t, { add->peer.t_ka = t; })
- OPT("-cork", { add->peer.
kx
f |= KXF_CORK; })
+ OPT("-cork", { add->peer.f |= KXF_CORK; })
OPTARG("-key", arg, {
if (add->peer.tag)
xfree(add->peer.tag);
add->peer.tag = xstrdup(arg);
})
OPTARG("-key", arg, {
if (add->peer.tag)
xfree(add->peer.tag);
add->peer.tag = xstrdup(arg);
})
+ OPT("-mobile", { add->peer.f |= PSF_MOBILE; })
});
/* --- Make sure someone's not got there already --- */
});
/* --- Make sure someone's not got there already --- */
@@
-2213,13
+2214,14
@@
void a_daemon(void) { flags |= F_DAEMON; }
* Arguments: @const char *name@ = socket name to create
* @uid_t u@ = user to own the socket
* @gid_t g@ = group to own the socket
* Arguments: @const char *name@ = socket name to create
* @uid_t u@ = user to own the socket
* @gid_t g@ = group to own the socket
+ * @mode_t m@ = permissions to set on the socket
*
* Returns: ---
*
* Use: Creates the admin listening socket.
*/
*
* Returns: ---
*
* Use: Creates the admin listening socket.
*/
-void a_init(const char *name, uid_t u, gid_t g)
+void a_init(const char *name, uid_t u, gid_t g
, mode_t m
)
{
int fd;
int n = 5;
{
int fd;
int n = 5;
@@
-2275,14
+2277,14
@@
again:
close(fd);
goto again;
}
close(fd);
goto again;
}
- if (chmod(sun.sun_path, 0600)) {
- die(EXIT_FAILURE, "failed to set socket permissions: %s",
- strerror(errno));
- }
if (chown(sun.sun_path, u, g)) {
die(EXIT_FAILURE, "failed to set socket owner: %s",
strerror(errno));
}
if (chown(sun.sun_path, u, g)) {
die(EXIT_FAILURE, "failed to set socket owner: %s",
strerror(errno));
}
+ if (chmod(sun.sun_path, m)) {
+ die(EXIT_FAILURE, "failed to set socket permissions: %s",
+ strerror(errno));
+ }
umask(omask);
fdflags(fd, O_NONBLOCK, O_NONBLOCK, FD_CLOEXEC, FD_CLOEXEC);
if (listen(fd, 5))
umask(omask);
fdflags(fd, O_NONBLOCK, O_NONBLOCK, FD_CLOEXEC, FD_CLOEXEC);
if (listen(fd, 5))