Displaying 1 result from an estimated 1 matches for "canonlen".
Did you mean:
canone
2010 Nov 28
2
[PATCH] Use canonical hostname for DNS SSHFP lookup
...fndef HAVE_GETADDRINFO
static struct
-addrinfo *malloc_ai(int port, u_long addr, const struct addrinfo *hints)
+addrinfo *malloc_ai(int port, u_long addr, const struct addrinfo *hints,
+ const char *canonname)
{
struct addrinfo *ai;
+ int len = sizeof(*ai) + sizeof(struct sockaddr_in);
+ int canonlen = 0;
- ai = malloc(sizeof(*ai) + sizeof(struct sockaddr_in));
+ if (canonname != NULL) {
+ canonlen = strlen (canonname);
+ len += canonlen + 1;
+ }
+
+ ai = malloc(len);
if (ai == NULL)
return (NULL);
- memset(ai, '\0', sizeof(*ai) + sizeof(struct sockaddr_in));
+ memset(ai, ...