[Bug 255019] ifconfig -f addr:host and ifconfig -f addr:fqdn return the same value
bugzilla-noreply at freebsd.org
bugzilla-noreply at freebsd.org
Mon Apr 12 20:55:20 UTC 2021
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=255019
Bug ID: 255019
Summary: ifconfig -f addr:host and ifconfig -f addr:fqdn return
the same value
Product: Base System
Version: CURRENT
Hardware: Any
OS: Any
Status: New
Severity: Affects Only Me
Priority: ---
Component: bin
Assignee: bugs at FreeBSD.org
Reporter: jcaplan at blackberry.com
Overview
--------
`ifconfig -f addr:host` does not properly truncate the fully qualify host name.
Steps to Reproduce
------------------
ifconfig vmx0 172.16.129.101/24 up
echo '172.16.129.101 dut.example.com' >> /etc/hosts
ifconfig -f addr:host vmx0
Actual Results
--------------
inet dut.example.com netmask 0xffffff00 broadcast 172.16.129.255
Exepcted Results
----------------
inet dut netmask 0xffffff00 broadcast 172.16.129.255
Additional Information
----------------------
In getnameinfo_inet(), it seems that NI_NOFQDN flag is deliberately ignored
because it's messy to determine whether or not the host is local.
#if 0
/*
* commented out, since "for local host" is not
* implemented here - see RFC2553 p30
*/
if (flags & NI_NOFQDN) {
char *p;
p = strchr(hp->h_name, '.');
if (p)
*p = '\0';
}
#endif
If no change is made to getnameinfo_inet(), at the very least ifconfig should
perform the truncation.
--
You are receiving this mail because:
You are the assignee for the bug.
More information about the freebsd-bugs
mailing list