mirror of
https://github.com/freebsd/freebsd-src.git
synced 2026-10-31 04:45:39 +01:00
import unbound 1.5.2
This commit is contained in:
1 parent
54dd3272da
commit
d3348d437f
59 files changed
+3593
-2691
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/vendor/unbound/dist/; revision=282009 svn path=/vendor/unbound/1.5.2/; revision=282010; tag=vendor/unbound/1.5.2
No files matched your search
@@ -48,6 +48,7 @@
|
||||
#include "util/data/msgreply.h"
|
||||
#include "util/storage/slabhash.h"
|
||||
#include "util/regional.h"
|
||||
#include "iterator/iter_delegpt.h"
|
||||
#include "ldns/sbuffer.h"
|
||||
|
||||
#undef _POSIX_C_SOURCE
|
||||
@@ -176,3 +177,17 @@ void reply_addr2str(struct comm_reply* reply, char* dest, int maxlen)
|
||||
return;
|
||||
dest[maxlen-1] = 0;
|
||||
}
|
||||
|
||||
/* Convert target->addr to string */
|
||||
void delegpt_addr_addr2str(struct delegpt_addr* target, char *dest, int maxlen)
|
||||
{
|
||||
int af = (int)((struct sockaddr_in*) &(target->addr))->sin_family;
|
||||
void* sinaddr = &((struct sockaddr_in*) &(target->addr))->sin_addr;
|
||||
|
||||
if(af == AF_INET6)
|
||||
sinaddr = &((struct sockaddr_in6*)&(target->addr))->sin6_addr;
|
||||
dest[0] = 0;
|
||||
if (inet_ntop(af, sinaddr, dest, (socklen_t)maxlen) == 0)
|
||||
return;
|
||||
dest[maxlen-1] = 0;
|
||||
}
|
||||
Reference in new issue
Block a user