NI_WITHSCOPEID cleanup
Reviewed by: gad
This commit is contained in:
parent
4f10131848
commit
9ccf2f38c1
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=146188
@ -230,13 +230,13 @@ checkremote(struct printer *pp)
|
||||
for (lr = local_res; lr; lr = lr->ai_next) {
|
||||
h1[0] = '\0';
|
||||
if (getnameinfo(lr->ai_addr, lr->ai_addrlen, h1, sizeof(h1),
|
||||
NULL, 0, NI_NUMERICHOST | NI_WITHSCOPEID) != 0)
|
||||
NULL, 0, NI_NUMERICHOST) != 0)
|
||||
continue;
|
||||
for (rr = remote_res; rr; rr = rr->ai_next) {
|
||||
h2[0] = '\0';
|
||||
if (getnameinfo(rr->ai_addr, rr->ai_addrlen,
|
||||
h2, sizeof(h2), NULL, 0,
|
||||
NI_NUMERICHOST | NI_WITHSCOPEID) != 0)
|
||||
NI_NUMERICHOST) != 0)
|
||||
continue;
|
||||
if (strcmp(h1, h2) == 0)
|
||||
ncommonaddrs++;
|
||||
|
@ -675,7 +675,7 @@ chkhost(struct sockaddr *f, int ch_opts)
|
||||
if (error) {
|
||||
errsav = error;
|
||||
error = getnameinfo(f, f->sa_len, hostbuf, sizeof(hostbuf),
|
||||
NULL, 0, NI_NUMERICHOST | NI_WITHSCOPEID);
|
||||
NULL, 0, NI_NUMERICHOST);
|
||||
if (error) {
|
||||
asprintf(&syserr,
|
||||
"can not determine hostname for remote host (%d,%d)",
|
||||
@ -701,7 +701,7 @@ chkhost(struct sockaddr *f, int ch_opts)
|
||||
|
||||
/* Need address in stringform for comparison (no DNS lookup here) */
|
||||
error = getnameinfo(f, f->sa_len, hostbuf, sizeof(hostbuf), NULL, 0,
|
||||
NI_NUMERICHOST | NI_WITHSCOPEID);
|
||||
NI_NUMERICHOST);
|
||||
if (error) {
|
||||
asprintf(&syserr, "Cannot print IP address (error %d)",
|
||||
error);
|
||||
@ -743,7 +743,7 @@ chkhost(struct sockaddr *f, int ch_opts)
|
||||
good = 0;
|
||||
for (r = res; good == 0 && r; r = r->ai_next) {
|
||||
error = getnameinfo(r->ai_addr, r->ai_addrlen, ip, sizeof(ip),
|
||||
NULL, 0, NI_NUMERICHOST | NI_WITHSCOPEID);
|
||||
NULL, 0, NI_NUMERICHOST);
|
||||
if (!error && !strcmp(from_ip, ip))
|
||||
good = 1;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user