diff options
| author | Laurent Bercot <ska-skaware@skarnet.org> | 2017-03-12 19:39:01 +0000 |
|---|---|---|
| committer | Laurent Bercot <ska-skaware@skarnet.org> | 2017-03-12 19:39:01 +0000 |
| commit | 53091e3bce487ee82e2805a0231e780551561717 (patch) | |
| tree | f0fa36ff8eadaf1f01d4510597b5e3a310764dc7 /src/libs6net/s6net_ident_client.c | |
| parent | f85b8a70f3b44510a5cf3895bf7357ae90655f65 (diff) | |
| download | s6-networking-53091e3bce487ee82e2805a0231e780551561717.tar.gz | |
Adapt to skalibs-2.5.0.0
Diffstat (limited to 'src/libs6net/s6net_ident_client.c')
| -rw-r--r-- | src/libs6net/s6net_ident_client.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/libs6net/s6net_ident_client.c b/src/libs6net/s6net_ident_client.c index e4f4b87..a014fe2 100644 --- a/src/libs6net/s6net_ident_client.c +++ b/src/libs6net/s6net_ident_client.c @@ -1,22 +1,22 @@ /* ISC license. */ +#include <string.h> #include <stdint.h> #include <errno.h> -#include <skalibs/bytestr.h> #include <skalibs/tai.h> #include <skalibs/ip46.h> #include <s6-networking/ident.h> -int s6net_ident_client (char *s, size_t max, ip46_t const *remoteip, uint16_t remoteport, ip46_t const *localip, uint16_t localport, tain_t const *deadline, tain_t *stamp) +ssize_t s6net_ident_client (char *s, size_t max, ip46_t const *remoteip, uint16_t remoteport, ip46_t const *localip, uint16_t localport, tain_t const *deadline, tain_t *stamp) { char buf[S6NET_IDENT_REPLY_SIZE] ; size_t len ; - register ssize_t r = s6net_ident_reply_get(buf, remoteip, remoteport, localip, localport, deadline, stamp) ; + ssize_t r = s6net_ident_reply_get(buf, remoteip, remoteport, localip, localport, deadline, stamp) ; if (r < 0) return errno == EPIPE ? (errno = EIO, 0) : -1 ; /* the RFC says so */ len = r ; r = s6net_ident_reply_parse(buf, remoteport, localport) ; if (r <= 0) return r ; if (max + r < len + 1) return (errno = ENAMETOOLONG, -1) ; - byte_copy(s, len - r + 1, buf + r) ; + memcpy(s, buf + r, len - r + 1) ; return len - r + 1 ; } |
