Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions dht.c
Original file line number Diff line number Diff line change
Expand Up @@ -1779,15 +1779,15 @@ dht_init(int s, int s6, const unsigned char *id, const unsigned char *v)
numstorage = 0;

if(s >= 0) {
buckets = calloc(sizeof(struct bucket), 1);
buckets = calloc(1, sizeof(struct bucket));
if(buckets == NULL)
return -1;
buckets->max_count = 128;
buckets->af = AF_INET;
}

if(s6 >= 0) {
buckets6 = calloc(sizeof(struct bucket), 1);
buckets6 = calloc(1, sizeof(struct bucket));
if(buckets6 == NULL)
return -1;
buckets6->max_count = 128;
Expand Down Expand Up @@ -2437,7 +2437,7 @@ dht_insert_node(const unsigned char *id, struct sockaddr *sa, int salen)
{
struct node *n;

if(sa->sa_family != AF_INET) {
if(sa->sa_family != AF_INET && sa->sa_family != AF_INET6) {
errno = EAFNOSUPPORT;
return -1;
}
Expand Down