History log of /freebsd-current/lib/libutil/realhostname.c
Revision Date Author Comments
# a2f733ab 24-Nov-2023 Warner Losh <imp@FreeBSD.org>

lib: Automated cleanup of cdefs and other formatting

Apply the following automated changes to try to eliminate
no-longer-needed sys/cdefs.h includes as well as now-empty
blank lines in a row.

Remove /^#if.*\n#endif.*\n#include\s+<sys/cdefs.h>.*\n/
Remove /\n+#include\s+<sys/cdefs.h>.*\n+#if.*\n#endif.*\n+/
Remove /\n+#if.*\n#endif.*\n+/
Remove /^#if.*\n#endif.*\n/
Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/types.h>/
Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/param.h>/
Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/capsicum.h>/

Sponsored by: Netflix


# 1d386b48 16-Aug-2023 Warner Losh <imp@FreeBSD.org>

Remove $FreeBSD$: one-line .c pattern

Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/


# 4d846d26 10-May-2023 Warner Losh <imp@FreeBSD.org>

spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD

The SPDX folks have obsoleted the BSD-2-Clause-FreeBSD identifier. Catch
up to that fact and revert to their recommended match of BSD-2-Clause.

Discussed with: pfg
MFC After: 3 days
Sponsored by: Netflix


# 5e53a4f9 25-Nov-2017 Pedro F. Giffuni <pfg@FreeBSD.org>

lib: further adoption of SPDX licensing ID tags.

Mainly focus on files that use BSD 2-Clause license, however the tool I
was using mis-identified many licenses so this was mostly a manual - error
prone - task.

The Software Package Data Exchange (SPDX) group provides a specification
to make it easier for automated tools to detect and summarize well known
opensource licenses. We are gradually adopting the specification, noting
that the tags are considered only advisory and do not, in any way,
superceed or replace the license texts.


# a7d5f7eb 19-Oct-2010 Jamie Gritton <jamie@FreeBSD.org>

A new jail(8) with a configuration file, to replace the work currently done
by /etc/rc.d/jail.


# fe0506d7 09-Mar-2010 Marcel Moolenaar <marcel@FreeBSD.org>

Create the altix project branch. The altix project will add support
for the SGI Altix 350 to FreeBSD/ia64. The hardware used for porting
is a two-module system, consisting of a base compute module and a
CPU expansion module. SGI's NUMAFlex architecture can be an excellent
platform to test CPU affinity and NUMA-aware features in FreeBSD.


# ca938a2c 24-Nov-2008 Tai-hwa Liang <avatar@FreeBSD.org>

Fixing !INET6 builds.


# 31cfde71 04-Nov-2008 Dag-Erling Smørgrav <des@FreeBSD.org>

Like many other functions that handle sockaddrs, realhostname_sa() takes a
struct sockaddr * that it casts internally to the appropriate type based on
sa_family. However, struct sockaddr has very lax alignment requirements,
which causes the compiler to complain when you cast a struct sockaddr * to,
say, a struct sockaddr_in6 *.

I find it reasonable to assume that the pointer we received is in fact
correctly aligned. Therefore, we can work around the compiler warnings by
casting to void * before casting to the desired type. For readability's
sake, this is done with macros.

The same technique should prove useful in other parts of the tree that
deal with socket addresses.

MFC after: 3 weeks


# d7f03759 19-Oct-2008 Ulf Lilleengen <lulf@FreeBSD.org>

- Import the HEAD csup code which is the basis for the cvsmode work.


# 0ea291e2 17-Oct-2008 Xin LI <delphij@FreeBSD.org>

Use strlcpy() when we mean it.


# 4f101318 13-May-2005 Hajimu UMEMOTO <ume@FreeBSD.org>

NI_WITHSCOPEID cleanup. Neither RFC 2553 nor RFC 3493 defines
NI_WITHSCOPEID, and our getaddrinfo(3) does nothing special
for it, now.


# 547fa0d9 18-Oct-2003 Mark Murray <markm@FreeBSD.org>

ANSIfy, WARNSify, CONSTify. Bit of style(9)-ify.


# 0ebec5d3 14-Jun-2003 Mark Murray <markm@FreeBSD.org>

Tidy up. Sort headers.


# 82684fa6 07-Jun-2002 Hajimu UMEMOTO <ume@FreeBSD.org>

Return HOSTNAME_INVALIDADDR when reverse lookup is fail.

Submitted by: Sergey Zorin <sergey@cc.tpu.edu.ru>


# 8719c58f 30-Sep-2001 Matthew Dillon <dillon@FreeBSD.org>

Add __FBSDID()s to libutil


# 27daeab3 23-Jul-2001 Hajimu UMEMOTO <ume@FreeBSD.org>

Simplify IPv4 mapped IPv6 address handling.

Reviewed by: brian
MFC after: 5 days


# 3ee63d39 20-Jul-2001 Brian Somers <brian@FreeBSD.org>

Hint getaddrinfo() correctly if we're looking up a name that we got from
an AF_INET6 address.

MFC after: 1 week


# ec86eec7 14-Mar-2001 Brian Somers <brian@FreeBSD.org>

MAXHOSTNAMELEN includes space for the NUL
Don't read past the end of the host passed to realhostname()

Not objected to by: freebsd-audit
Interface disliked by: imp


# f169f2f0 28-Jan-2001 Brian Somers <brian@FreeBSD.org>

Call trimdomain properly for ip4 addresses.

PR: 24659
realhostname_sa() stuff submitted by: Jim.Pirzyk@disney.com


# 6484396e 14-Jul-2000 Hajimu UMEMOTO <ume@FreeBSD.org>

Sshd writes connected host into utmp directly. If the connection is
via IPv6, the hostname is trimed due to the length of IPv6 address.
This change saves it as possible.
I have a grudge against the shortage of UT_HOSTSIZE.


# 4efe647d 24-May-2000 Hajimu UMEMOTO <ume@FreeBSD.org>

We should see the ai_canonname menber of the first addrinfo
structure in the linked list. RFC2553 mentions only first.

Reviewed by: shin


# 9ed4e87c 23-Mar-2000 Hajimu UMEMOTO <ume@FreeBSD.org>

Return IPv4 native address for IPv4 mapped IPv6 address, even if
A RR is not found.

Reviewed by: shin


# 88f853e0 07-Mar-2000 Hajimu UMEMOTO <ume@FreeBSD.org>

Since crypto/openssh/login.c was changed to use realhostname_sa(),
when connecting via IPv6, hostname was not recorded to utmp anymore.
Because, if hostname is longer than buffer size, getnameinfo() returns
with ENI_MEMORY.

Reviewed by: shin
Approved by: jkh


# 01d81a03 27-Jan-2000 Yoshinobu Inoue <shin@FreeBSD.org>

Avoid core dump when ai_canonname is NULL.
(Now this happens for numeric addrs, as getaddrinfo() 1.3 -> 1.4 change)

Reviewed by: Mark Huizer <xaa@timewasters.nl>


# 0cac72f4 25-Jan-2000 Yoshinobu Inoue <shin@FreeBSD.org>

several tcp apps IPv6 update
-inetd
-rshd
-rlogind
-telnetd
-rsh
-rlogin

Reviewed by: freebsd-arch, cvs-committers
Obtained from: KAME project


# 7f3dea24 27-Aug-1999 Peter Wemm <peter@FreeBSD.org>

$Id$ -> $FreeBSD$


# bc19c851 07-Apr-1999 Brian Somers <brian@FreeBSD.org>

Put parenthesis around sizeof args.
Allow for host names up to MAXHOSTNAMELEN - 1 in length.

Prompted by: bde


# 595f220e 06-Apr-1999 Brian Somers <brian@FreeBSD.org>

Add realhostname() - a function to correctly lookup
a name by address and ensure that the name resolves
back to the original address.