Message271283
Sorry, to add a data point, in C, `gethostbyname` also does the correct thing on macOS.
See:
```
#include <stdio.h>
#include <errno.h>
#include <netdb.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
int main(int argc, char *argv[]) {
int i;
struct hostent *lh = gethostbyname("0177.0000.0000.0001");
struct in_addr **addr_list;
if (lh) {
addr_list = (struct in_addr **)lh->h_addr_list;
for (i=0; addr_list[i] != NULL; i++) {
printf("%s", inet_ntoa(*addr_list[i]));
}
printf("\n");
} else {
herror("gethostbyname");
}
return 0;
}
```
So I'm not sure this is platform specific.
Either way, `socket.gethostbyname` is wrong on both linux and macOS. I'm a bit lost with what's going on here though, admittedly. :) |
|
Date |
User |
Action |
Args |
2016-07-25 15:22:37 | mattrobenolt | set | recipients:
+ mattrobenolt, ronaldoussoren, ned.deily, r.david.murray, koobs, xiang.zhang |
2016-07-25 15:22:37 | mattrobenolt | set | messageid: <1469460157.74.0.151827114957.issue27612@psf.upfronthosting.co.za> |
2016-07-25 15:22:37 | mattrobenolt | link | issue27612 messages |
2016-07-25 15:22:37 | mattrobenolt | create | |
|