projects
/
tinc
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Resolve the local host name before generating the invitation file.
[tinc]
/
src
/
invitation.c
diff --git
a/src/invitation.c
b/src/invitation.c
index
f1cde58
..
550fb5d
100644
(file)
--- a/
src/invitation.c
+++ b/
src/invitation.c
@@
-32,12
+32,6
@@
#include "utils.h"
#include "xalloc.h"
#include "utils.h"
#include "xalloc.h"
-#ifdef HAVE_MINGW
-#define SCRIPTEXTENSION ".bat"
-#else
-#define SCRIPTEXTENSION ""
-#endif
-
int addressfamily = AF_UNSPEC;
char *get_my_hostname() {
int addressfamily = AF_UNSPEC;
char *get_my_hostname() {
@@
-362,6
+356,9
@@
int cmd_invite(int argc, char *argv[]) {
if(!f)
abort();
if(!f)
abort();
+ // Get the local address
+ char *address = get_my_hostname();
+
// Fill in the details.
fprintf(f, "Name = %s\n", argv[1]);
if(netname)
// Fill in the details.
fprintf(f, "Name = %s\n", argv[1]);
if(netname)
@@
-376,7
+373,6
@@
int cmd_invite(int argc, char *argv[]) {
fclose(f);
// Create an URL from the local address, key hash and cookie
fclose(f);
// Create an URL from the local address, key hash and cookie
- char *address = get_my_hostname();
printf("%s/%s%s\n", address, hash, cookie);
free(filename);
free(address);
printf("%s/%s%s\n", address, hash, cookie);
free(filename);
free(address);