Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 1445355 Details for
Bug 1579928
using auth.allow with hostnames or fqdn breaks volume; volume heal info errors
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
getaddr.c
getaddr.c (text/x-csrc), 2.10 KB, created by
Mohit Agrawal
on 2018-05-29 11:35:49 UTC
(
hide
)
Description:
getaddr.c
Filename:
MIME Type:
Creator:
Mohit Agrawal
Created:
2018-05-29 11:35:49 UTC
Size:
2.10 KB
patch
obsolete
>#include <stdio.h> >#include <sys/types.h> >#include <sys/socket.h> >#include <netdb.h> >#include <string.h> >#include <stdlib.h> > > >int >gf_is_same_address (char *name1, char *name2) >{ > struct addrinfo *addr1 = NULL; > struct addrinfo *addr2 = NULL; > struct addrinfo *p = NULL; > struct addrinfo *q = NULL; > int ret = -1; > int gai_err = 0; > struct addrinfo hints; > > memset (&hints, 0, sizeof (hints)); > hints.ai_family = AF_UNSPEC; > > gai_err = getaddrinfo(name1, NULL, &hints, &addr1); > if (gai_err != 0) { > printf ("error in getaddrinfo: %s for name1\n", gai_strerror(gai_err)); > goto out; > } > > gai_err = getaddrinfo(name2, NULL, &hints, &addr2); > if (gai_err != 0) { > printf ("error in getaddrinfo: %s for name2\n", gai_strerror(gai_err)); > goto out; > } > > for (p = addr1; p; p = p->ai_next) { > for (q = addr2; q; q = q->ai_next) { > if (p->ai_addrlen != q->ai_addrlen) { > continue; > } > if (memcmp(p->ai_addr,q->ai_addr,p->ai_addrlen)) { > continue; > } > ret = 0; > goto out; > } > } > >out: > if (addr1) { > freeaddrinfo(addr1); > } > if (addr2) { > freeaddrinfo(addr2); > } > return ret; > >} > >int main(int argc, char *argv[]) { > > if (argc != 3) { > printf ("Pass correct no. of argument as <host-name> <ip-addr>"); > exit (1); > } > > char *hname = argv[1]; > char *ip = argv[2]; > int ret; > > if (!gf_is_same_address (hname, ip)) { > printf("hostname %s is matched with ip %s addr by DNS\n", hname, ip); > } else { > printf("hostname %s does not match with ip %s addr by DNS\n", hname, ip); > } >}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 1579928
: 1445355