diff options
| author | Roy Marples <roy@marples.name> | 2016-11-10 18:26:32 +0000 |
|---|---|---|
| committer | Roy Marples <roy@marples.name> | 2016-11-10 18:26:32 +0000 |
| commit | 1f7c845e537ad295450b2d6da707fe71fe443670 (patch) | |
| tree | b306523fbc92af51b8799f6ebe35cd2289cd01f3 | |
| parent | f0353a809f889a04857bb18fc356d4a68dda2c9d (diff) | |
| download | dhcpcd-1f7c845e537ad295450b2d6da707fe71fe443670.tar.xz | |
Set sa_len when creating a sockaddr from a prefix.
| -rw-r--r-- | sa.c | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -284,11 +284,17 @@ sa_fromprefix(struct sockaddr *sa, int prefix) #ifdef INET case AF_INET: max_prefix = 32; +#ifdef HAVE_SA_LEN + sa->sa_len = sizeof(struct in_addr); +#endif break; #endif #ifdef INET6 case AF_INET6: max_prefix = 128; +#ifdef HAVE_SA_LEN + sa->sa_len = sizeof(struct in6_addr); +#endif break; #endif default: |
