-/* $OpenBSD: addr_range.c,v 1.7 2024/02/26 08:25:51 yasuoka Exp $ */
+/* $OpenBSD: addr_range.c,v 1.8 2024/08/22 07:56:47 florian Exp $ */
/*-
* Copyright (c) 2009 Internet Initiative Japan Inc.
* All rights reserved.
* Author:
* Yasuoka Masahiko <yasuoka@iij.ad.jp>
*
- * $Id: addr_range.c,v 1.7 2024/02/26 08:25:51 yasuoka Exp $
+ * $Id: addr_range.c,v 1.8 2024/08/22 07:56:47 florian Exp $
*/
#ifdef ADDR_RANGE_DEBUG
#define IIJDEBUG
#endif
#include <sys/types.h>
+#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
is_maskaddr = 1;
}
- if (inet_aton(p0, &a0) != 1) {
+ if (inet_pton(AF_INET, p0, &a0) != 1) {
if (errno == 0)
errno = EINVAL;
#ifdef IIJDEBUG
saved_errno = errno;
- log_printf(LOG_DL_1, "inet_aton(%s) failed: %m", p0);
+ log_printf(LOG_DL_1, "inet_pton(%s) failed: %m", p0);
errno = saved_errno;
#endif
free(p0);
return -1;
}
- if ((is_range || is_maskaddr) && inet_aton(p1, &a1) != 1) {
+ if ((is_range || is_maskaddr) && inet_pton(AF_INET, p1, &a1) != 1) {
if (errno == 0)
errno = EINVAL;
#ifdef IIJDEBUG
saved_errno = errno;
- log_printf(LOG_DL_1, "inet_aton(%s) failed: %m", p1);
+ log_printf(LOG_DL_1, "inet_pton(%s) failed: %m", p1);
errno = saved_errno;
#endif
free(p0);
-/* $OpenBSD: npppd_subr.c,v 1.21 2021/03/29 03:54:39 yasuoka Exp $ */
+/* $OpenBSD: npppd_subr.c,v 1.22 2024/08/22 07:56:47 florian Exp $ */
/*-
* Copyright (c) 2009 Internet Initiative Japan Inc.
addr = pri;
else
addr = sec;
- if (inet_aton(ap, addr) != 1) {
+ if (inet_pton(AF_INET, ap, addr) != 1) {
/*
* FIXME: If configured IPv6, it may have IPv6
* FIXME: address. For the present, continue.
-/* $OpenBSD: parse.y,v 1.30 2024/07/17 08:26:19 yasuoka Exp $ */
+/* $OpenBSD: parse.y,v 1.31 2024/08/22 07:56:47 florian Exp $ */
/*
* Copyright (c) 2002, 2003, 2004 Henning Brauer <henning@openbsd.org>
;
in4_addr : STRING {
- if (inet_aton($1, &($$)) != 1) {
+ if (inet_pton(AF_INET, $1, &($$)) != 1) {
yyerror("could not parse the address %s", $1);
free($1);
YYERROR;
-/* $OpenBSD: privsep.c,v 1.25 2024/01/18 09:58:23 claudio Exp $ */
+/* $OpenBSD: privsep.c,v 1.26 2024/08/22 07:56:47 florian Exp $ */
/*
* Copyright (c) 2010 Yasuoka Masahiko <yasuoka@openbsd.org>
}
if ((retval = cgetstr(buf, "framed-ip-address",
&str)) >= 0) {
- if (inet_aton(str,
+ if (inet_pton(AF_INET, str,
&r.framed_ip_address) != 1)
goto on_broken_entry;
free(str);
if ((retval = cgetstr(buf, "framed-ip-netmask",
&str)) >= 0) {
- if (inet_aton(str,
+ if (inet_pton(AF_INET, str,
&r.framed_ip_netmask) != 1)
goto on_broken_entry;
free(str);