diff options
| author | David Edmondson | 2016-02-07 12:54:08 +1100 |
|---|---|---|
| committer | Lars Ingebrigtsen | 2016-02-07 12:55:57 +1100 |
| commit | 35cbe2095ba024f6ee60799cd560771f2ef739a4 (patch) | |
| tree | 4f3e10ad79c16e387fddb6301efebbe86443e129 /src/process.c | |
| parent | 9ffe7ddd5e1ba93f327cfe985e9476571d7a2873 (diff) | |
| download | emacs-35cbe2095ba024f6ee60799cd560771f2ef739a4.tar.gz emacs-35cbe2095ba024f6ee60799cd560771f2ef739a4.zip | |
src/process.c Correctly convert AF_INET6 addresses
* src/process.c (conv_lisp_to_sockaddr): AF_INET6 addresses are
converted to a list of 16 bit quantities by
conv_sockaddr_to_lisp(). conv_lisp_to_sockaddr() should follow the
same scheme rather than expecting a (longer) list of 8 bit
quantities.
Backport:
(cherry picked from commit 55ce3c30d617c38eb086d5ad4ffbd881c20c559c)
Diffstat (limited to 'src/process.c')
| -rw-r--r-- | src/process.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/process.c b/src/process.c index e1ebdff7430..1eac5e12663 100644 --- a/src/process.c +++ b/src/process.c | |||
| @@ -2372,7 +2372,7 @@ conv_lisp_to_sockaddr (int family, Lisp_Object address, struct sockaddr *sa, int | |||
| 2372 | { | 2372 | { |
| 2373 | struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *) sa; | 2373 | struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *) sa; |
| 2374 | uint16_t *ip6 = (uint16_t *)&sin6->sin6_addr; | 2374 | uint16_t *ip6 = (uint16_t *)&sin6->sin6_addr; |
| 2375 | len = sizeof (sin6->sin6_addr) + 1; | 2375 | len = sizeof (sin6->sin6_addr) / 2 + 1; |
| 2376 | hostport = XINT (p->contents[--len]); | 2376 | hostport = XINT (p->contents[--len]); |
| 2377 | sin6->sin6_port = htons (hostport); | 2377 | sin6->sin6_port = htons (hostport); |
| 2378 | for (i = 0; i < len; i++) | 2378 | for (i = 0; i < len; i++) |