diff options
author | Matthias Schiffer <mschiffer@universe-factory.net> | 2013-07-12 01:10:25 +0200 |
---|---|---|
committer | Matthias Schiffer <mschiffer@universe-factory.net> | 2013-07-12 01:10:25 +0200 |
commit | 96d8f1a90009cceb08d05478b15a20e51d1275e7 (patch) | |
tree | dbf694c3ddaff391096068452750e98482fd94f7 /src | |
parent | a8f545dbe18f7987d97c83b69d28eb1d37e3031e (diff) | |
download | fastd-96d8f1a90009cceb08d05478b15a20e51d1275e7.tar fastd-96d8f1a90009cceb08d05478b15a20e51d1275e7.zip |
Supply the correct sockaddr size for bind
Diffstat (limited to 'src')
-rw-r--r-- | src/fastd.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/fastd.c b/src/fastd.c index 63c5750..b78fa34 100644 --- a/src/fastd.c +++ b/src/fastd.c @@ -257,7 +257,7 @@ static int bind_socket(fastd_context_t *ctx, const fastd_bind_address_t *addr, b bind_address.in.sin_port = addr->addr.in.sin_port; } - if (bind(fd, (struct sockaddr*)&bind_address, af == AF_INET6 ? sizeof(struct sockaddr_in6) : sizeof(struct sockaddr_in))) { + if (bind(fd, (struct sockaddr*)&bind_address, bind_address.sa.sa_family == AF_INET6 ? sizeof(struct sockaddr_in6) : sizeof(struct sockaddr_in))) { if (warn) pr_warn_errno(ctx, "bind"); goto error; |