Commit 93b632a7 authored by Thomas Haller's avatar Thomas Haller

release: bump version to 1.7.1-dev after 1.6.0 release

After 1.6.0 is released, merge it back into master so that
1.6.0 is part of the history of master. That means,
  $ git log --first-parent master
will also traverse 1.6.0 and 1.6-rc*.

Also bump the micro version to 1.7.1-dev to indicate that this is
after 1.6.0 is out.
parents 2554a873 2131e985
......@@ -2,8 +2,8 @@ AC_PREREQ([2.63])
dnl The NM version number
m4_define([nm_major_version], [1])
m4_define([nm_minor_version], [6])
m4_define([nm_micro_version], [0])
m4_define([nm_minor_version], [7])
m4_define([nm_micro_version], [1])
m4_define([nm_version],
[nm_major_version.nm_minor_version.nm_micro_version])
......
......@@ -118,4 +118,18 @@
# define NM_AVAILABLE_IN_1_6
#endif
#if NM_VERSION_MIN_REQUIRED >= NM_VERSION_1_8
# define NM_DEPRECATED_IN_1_8 G_DEPRECATED
# define NM_DEPRECATED_IN_1_8_FOR(f) G_DEPRECATED_FOR(f)
#else
# define NM_DEPRECATED_IN_1_8
# define NM_DEPRECATED_IN_1_8_FOR(f)
#endif
#if NM_VERSION_MAX_ALLOWED < NM_VERSION_1_8
# define NM_AVAILABLE_IN_1_8 G_UNAVAILABLE(1,8)
#else
# define NM_AVAILABLE_IN_1_8
#endif
#endif /* NM_VERSION_H */
......@@ -118,4 +118,18 @@
# define NM_AVAILABLE_IN_1_6
#endif
#if NM_VERSION_MIN_REQUIRED >= NM_VERSION_1_8
# define NM_DEPRECATED_IN_1_8 G_DEPRECATED
# define NM_DEPRECATED_IN_1_8_FOR(f) G_DEPRECATED_FOR(f)
#else
# define NM_DEPRECATED_IN_1_8
# define NM_DEPRECATED_IN_1_8_FOR(f)
#endif
#if NM_VERSION_MAX_ALLOWED < NM_VERSION_1_8
# define NM_AVAILABLE_IN_1_8 G_UNAVAILABLE(1,8)
#else
# define NM_AVAILABLE_IN_1_8
#endif
#endif /* NM_VERSION_H */
......@@ -70,9 +70,10 @@
#define NM_VERSION_1_2 (NM_ENCODE_VERSION (1, 2, 0))
#define NM_VERSION_1_4 (NM_ENCODE_VERSION (1, 4, 0))
#define NM_VERSION_1_6 (NM_ENCODE_VERSION (1, 6, 0))
#define NM_VERSION_1_8 (NM_ENCODE_VERSION (1, 8, 0))
#define NM_VERSION_CUR_STABLE NM_VERSION_1_4
#define NM_VERSION_NEXT_STABLE NM_VERSION_1_6
#define NM_VERSION_CUR_STABLE NM_VERSION_1_6
#define NM_VERSION_NEXT_STABLE NM_VERSION_1_8
#define NM_VERSION NM_ENCODE_VERSION (NM_MAJOR_VERSION, NM_MINOR_VERSION, NM_MICRO_VERSION)
......
......@@ -806,8 +806,10 @@ int chase_symlinks(const char *path, const char *original_root, unsigned flags,
return -ENOMEM;
}
*ret = done;
done = NULL;
if (ret) {
*ret = done;
done = NULL;
}
return exists;
}
......
......@@ -99,6 +99,9 @@ int unhexmem(const char *p, size_t l, void **mem, size_t *len) {
assert(len);
assert(p);
if (l % 2 != 0)
return -EINVAL;
z = r = malloc((l + 1) / 2 + 1);
if (!r)
return -ENOMEM;
......@@ -109,12 +112,10 @@ int unhexmem(const char *p, size_t l, void **mem, size_t *len) {
a = unhexchar(x[0]);
if (a < 0)
return a;
else if (x+1 < p + l) {
b = unhexchar(x[1]);
if (b < 0)
return b;
} else
b = 0;
b = unhexchar(x[1]);
if (b < 0)
return b;
*(z++) = (uint8_t) a << 4 | (uint8_t) b;
}
......
......@@ -116,6 +116,30 @@ int socket_address_parse(SocketAddress *a, const char *s) {
memcpy(a->sockaddr.un.sun_path+1, s+1, l);
a->size = offsetof(struct sockaddr_un, sun_path) + 1 + l;
} else if (startswith(s, "vsock:")) {
/* AF_VSOCK socket in vsock:cid:port notation */
const char *cid_start = s + strlen("vsock:");
e = strchr(cid_start, ':');
if (!e)
return -EINVAL;
r = safe_atou(e+1, &u);
if (r < 0)
return r;
n = strndupa(cid_start, e - cid_start);
if (!isempty(n)) {
r = safe_atou(n, &a->sockaddr.vm.svm_cid);
if (r < 0)
return r;
} else
a->sockaddr.vm.svm_cid = VMADDR_CID_ANY;
a->sockaddr.vm.svm_family = AF_VSOCK;
a->sockaddr.vm.svm_port = u;
a->size = sizeof(struct sockaddr_vm);
} else {
e = strchr(s, ':');
if (e) {
......@@ -292,6 +316,15 @@ int socket_address_verify(const SocketAddress *a) {
return 0;
case AF_VSOCK:
if (a->size != sizeof(struct sockaddr_vm))
return -EINVAL;
if (a->type != SOCK_STREAM && a->type != SOCK_DGRAM)
return -EINVAL;
return 0;
default:
return -EAFNOSUPPORT;
}
......@@ -397,6 +430,15 @@ bool socket_address_equal(const SocketAddress *a, const SocketAddress *b) {
break;
case AF_VSOCK:
if (a->sockaddr.vm.svm_cid != b->sockaddr.vm.svm_cid)
return false;
if (a->sockaddr.vm.svm_port != b->sockaddr.vm.svm_port)
return false;
break;
default:
/* Cannot compare, so we assume the addresses are different */
return false;
......@@ -483,15 +525,27 @@ bool socket_address_matches_fd(const SocketAddress *a, int fd) {
return socket_address_equal(a, &b);
}
int sockaddr_port(const struct sockaddr *_sa) {
int sockaddr_port(const struct sockaddr *_sa, unsigned *port) {
union sockaddr_union *sa = (union sockaddr_union*) _sa;
assert(sa);
if (!IN_SET(sa->sa.sa_family, AF_INET, AF_INET6))
return -EAFNOSUPPORT;
switch (sa->sa.sa_family) {
case AF_INET:
*port = be16toh(sa->in.sin_port);
return 0;
case AF_INET6:
*port = be16toh(sa->in6.sin6_port);
return 0;
case AF_VSOCK:
*port = sa->vm.svm_port;
return 0;
return be16toh(sa->sa.sa_family == AF_INET6 ? sa->in6.sin6_port : sa->in.sin_port);
default:
return -EAFNOSUPPORT;
}
}
int sockaddr_pretty(const struct sockaddr *_sa, socklen_t salen, bool translate_ipv6, bool include_port, char **ret) {
......@@ -594,6 +648,18 @@ int sockaddr_pretty(const struct sockaddr *_sa, socklen_t salen, bool translate_
break;
case AF_VSOCK:
if (include_port)
r = asprintf(&p,
"vsock:%u:%u",
sa->vm.svm_cid,
sa->vm.svm_port);
else
r = asprintf(&p, "vsock:%u", sa->vm.svm_cid);
if (r < 0)
return -ENOMEM;
break;
default:
return -EOPNOTSUPP;
}
......@@ -751,6 +817,9 @@ bool sockaddr_equal(const union sockaddr_union *a, const union sockaddr_union *b
if (a->sa.sa_family == AF_INET6)
return memcmp(&a->in6.sin6_addr, &b->in6.sin6_addr, sizeof(a->in6.sin6_addr)) == 0;
if (a->sa.sa_family == AF_VSOCK)
return a->vm.svm_cid == b->vm.svm_cid;
return false;
}
......@@ -1012,6 +1081,7 @@ fallback:
return (ssize_t) k;
}
#if 0 /* NM_IGNORED */
int flush_accept(int fd) {
struct pollfd pollfd = {
......@@ -1081,3 +1151,4 @@ int socket_ioctl_fd(void) {
return fd;
}
#endif /* NM_IGNORED */
......@@ -30,6 +30,7 @@
#include <linux/if_packet.h>
#include "macro.h"
#include "missing.h"
#include "util.h"
union sockaddr_union {
......@@ -40,6 +41,9 @@ union sockaddr_union {
struct sockaddr_nl nl;
struct sockaddr_storage storage;
struct sockaddr_ll ll;
#if 0 /* NM_IGNORED */
struct sockaddr_vm vm;
#endif /* NM_IGNORED */
};
typedef struct SocketAddress {
......@@ -100,7 +104,7 @@ const char* socket_address_get_path(const SocketAddress *a);
bool socket_ipv6_is_supported(void);
int sockaddr_port(const struct sockaddr *_sa) _pure_;
int sockaddr_port(const struct sockaddr *_sa, unsigned *port);
int sockaddr_pretty(const struct sockaddr *_sa, socklen_t salen, bool translate_ipv6, bool include_port, char **ret);
int getpeername_pretty(int fd, bool include_port, char **ret);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment