-/* $OpenBSD: asr.c,v 1.46 2015/10/07 13:59:34 deraadt Exp $ */
+/* $OpenBSD: asr.c,v 1.47 2015/10/28 11:52:26 deraadt Exp $ */
/*
* Copyright (c) 2010-2012 Eric Faurot <eric@openbsd.org>
*
static int
asr_parse_nameserver(struct sockaddr *sa, const char *s)
{
- const char *estr;
- char buf[256];
- char *port = NULL;
in_port_t portno = 53;
- if (*s == '[') {
- strlcpy(buf, s + 1, sizeof buf);
- s = buf;
- port = strchr(buf, ']');
- if (port == NULL)
- return (-1);
- *port++ = '\0';
- if (*port != ':')
- return (-1);
- port++;
- }
-
- if (port) {
- portno = strtonum(port, 1, USHRT_MAX, &estr);
- if (estr)
- return (-1);
- }
-
if (_asr_sockaddr_from_str(sa, PF_UNSPEC, s) == -1)
return (-1);
-.\" $OpenBSD: resolv.conf.5,v 1.46 2014/11/05 15:12:23 jmc Exp $
+.\" $OpenBSD: resolv.conf.5,v 1.47 2015/10/28 11:52:26 deraadt Exp $
.\" $NetBSD: resolv.conf.5,v 1.7 1996/03/06 18:22:16 scottr Exp $
.\"
.\" Copyright (c) 1986, 1991 The Regents of the University of California.
.\"
.\" @(#)resolver.5 5.12 (Berkeley) 5/10/91
.\"
-.Dd $Mdocdate: November 5 2014 $
+.Dd $Mdocdate: October 28 2015 $
.Dt RESOLV.CONF 5
.Os
.Sh NAME
(see
.Xr inet6 4
for details).
-A non-standard port may also be specified,
-with the host address enclosed in square brackets.
-For example:
-.Bd -literal -offset indent
-nameserver [10.0.0.1]:5353
-nameserver [::1]:5353
-.Ed
.Pp
Up to
.Dv MAXNS