Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 1 | The musl implementation of getaddrinfo and getservbyname does not |
| 2 | aliases. As a workaround we use "sunprc" instead of "portmapper" |
| 3 | |
| 4 | ported from alpine linux |
| 5 | |
| 6 | Signed-off-by: Khem Raj <raj.khem@gmail.com> |
| 7 | |
| 8 | Index: rpcbind-0.2.2/src/rpcbind.c |
| 9 | =================================================================== |
| 10 | --- rpcbind-0.2.2.orig/src/rpcbind.c |
| 11 | +++ rpcbind-0.2.2/src/rpcbind.c |
| 12 | @@ -491,7 +491,7 @@ init_transport(struct netconfig *nconf) |
| 13 | if ((aicode = getaddrinfo(hosts[nhostsbak], |
| 14 | servname, &hints, &res)) != 0) { |
| 15 | if ((aicode = getaddrinfo(hosts[nhostsbak], |
| 16 | - "portmapper", &hints, &res)) != 0) { |
| 17 | + "sunrpc", &hints, &res)) != 0) { |
| 18 | syslog(LOG_ERR, |
| 19 | "cannot get local address for %s: %s", |
| 20 | nconf->nc_netid, gai_strerror(aicode)); |
| 21 | @@ -564,7 +564,7 @@ init_transport(struct netconfig *nconf) |
| 22 | if ((strcmp(nconf->nc_netid, "local") != 0) && |
| 23 | (strcmp(nconf->nc_netid, "unix") != 0)) { |
| 24 | if ((aicode = getaddrinfo(NULL, servname, &hints, &res))!= 0) { |
| 25 | - if ((aicode = getaddrinfo(NULL, "portmapper", &hints, &res))!= 0) { |
| 26 | + if ((aicode = getaddrinfo(NULL, "sunrpc", &hints, &res))!= 0) { |
| 27 | printf("cannot get local address for %s: %s", nconf->nc_netid, gai_strerror(aicode)); |
| 28 | syslog(LOG_ERR, |
| 29 | "cannot get local address for %s: %s", |