diff options
| author | Eli Zaretskii | 2019-11-27 18:16:37 +0200 |
|---|---|---|
| committer | Eli Zaretskii | 2019-11-27 18:16:37 +0200 |
| commit | 39b3bc0082050af08e19d80059ddca66355559ce (patch) | |
| tree | 3b705deadf70fee3a99699a79a48c54c552c7a3f | |
| parent | 4eb7db5d4b84708912c63a77569c8adeeff6c640 (diff) | |
| download | emacs-39b3bc0082050af08e19d80059ddca66355559ce.tar.gz emacs-39b3bc0082050af08e19d80059ddca66355559ce.zip | |
; Fix recent change in w32.c
* src/w32.c (network_interface_list): Correct an embarrassing
typo and cleanup the code.
| -rw-r--r-- | src/w32.c | 19 |
1 files changed, 9 insertions, 10 deletions
| @@ -9642,8 +9642,7 @@ network_interface_list (bool full, unsigned short match) | |||
| 9642 | #else | 9642 | #else |
| 9643 | /* Kludge alert! OnLinkPrefixLength is only defined | 9643 | /* Kludge alert! OnLinkPrefixLength is only defined |
| 9644 | when compiling for Vista and later. */ | 9644 | when compiling for Vista and later. */ |
| 9645 | numbits = *(UINT8 *) (address->LeaseLifetime | 9645 | numbits = *(UINT8 *) (&address->LeaseLifetime + 1); |
| 9646 | + sizeof (address->LeaseLifetime)); | ||
| 9647 | #endif | 9646 | #endif |
| 9648 | } | 9647 | } |
| 9649 | else /* Windows XP */ | 9648 | else /* Windows XP */ |
| @@ -9652,14 +9651,14 @@ network_interface_list (bool full, unsigned short match) | |||
| 9652 | numbits = 0; | 9651 | numbits = 0; |
| 9653 | for ( ; prefix; prefix = prefix->Next) | 9652 | for ( ; prefix; prefix = prefix->Next) |
| 9654 | { | 9653 | { |
| 9655 | /* We want the longest matching prefix. */ | 9654 | /* We want the longest matching prefix. */ |
| 9656 | if (prefix->Address.lpSockaddr->sa_family | 9655 | if ((prefix->Address.lpSockaddr->sa_family |
| 9657 | != ifa_addr->sa_family | 9656 | == ifa_addr->sa_family) |
| 9658 | || prefix->PrefixLength <= numbits) | 9657 | && (prefix->PrefixLength > numbits) |
| 9659 | continue; | 9658 | && address_prefix_match (ifa_addr->sa_family, |
| 9660 | if (address_prefix_match (ifa_addr->sa_family, ifa_addr, | 9659 | ifa_addr, |
| 9661 | prefix->Address.lpSockaddr, | 9660 | prefix->Address.lpSockaddr, |
| 9662 | prefix->PrefixLength)) | 9661 | prefix->PrefixLength)) |
| 9663 | numbits = prefix->PrefixLength; | 9662 | numbits = prefix->PrefixLength; |
| 9664 | } | 9663 | } |
| 9665 | if (!numbits) | 9664 | if (!numbits) |