-/* $OpenBSD: auth.c,v 1.42 2024/08/10 05:32:28 jsg Exp $ */
+/* $OpenBSD: auth.c,v 1.43 2024/08/21 14:57:05 florian Exp $ */
/*
* auth.c - PPP authentication and phase control.
hp = gethostbyname(p);
if (hp != NULL && hp->h_addrtype == AF_INET)
wo->hisaddr = *(u_int32_t *)hp->h_addr;
- else if (inet_aton(p, &ina) == 1)
+ else if (inet_pton(AF_INET, p, &ina) == 1)
wo->hisaddr = ina.s_addr;
}
}
if (hp != NULL && hp->h_addrtype == AF_INET) {
ina.s_addr = *(u_int32_t *)hp->h_addr;
} else {
- r = inet_aton (ptr_word, &ina);
+ r = inet_pton(AF_INET, ptr_word, &ina);
if (ptr_mask == NULL) {
/* calculate appropriate mask for net */
ah = ntohl(ina.s_addr);
if (ptr_mask != NULL)
*ptr_mask = '/';
- if (r == 0)
+ if (r != 1)
syslog (LOG_WARNING,
"unknown host %s in auth. address list",
addrs->word);
-/* $OpenBSD: options.c,v 1.32 2024/08/10 05:32:28 jsg Exp $ */
+/* $OpenBSD: options.c,v 1.33 2024/08/21 14:57:05 florian Exp $ */
/*
* options.c - handles option processing for PPP.
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <sys/stat.h>
+
#include <ctype.h>
#include <stdio.h>
#include <errno.h>
#include <string.h>
#include <netdb.h>
#include <pwd.h>
-#include <sys/types.h>
-#include <sys/stat.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#ifdef PPP_FILTER
*/
if (colon != arg) {
*colon = '\0';
- if (inet_aton(arg, &ina) == 0) {
+ if (inet_pton(AF_INET, arg, &ina) != 1) {
if ((hp = gethostbyname(arg)) == NULL) {
option_error("unknown host: %s", arg);
return -1;
* If colon last character, then no remote addr.
*/
if (*++colon != '\0') {
- if (inet_aton(colon, &ina) == 0) {
+ if (inet_pton(AF_INET, colon, &ina) != 1) {
if ((hp = gethostbyname(colon)) == NULL) {
option_error("unknown host: %s", colon);
return -1;
{
struct in_addr ina;
- if (inet_aton(*argv, &ina) == 0 || (netmask & ~ina.s_addr) != 0) {
+ if (inet_pton(AF_INET, *argv, &ina) != 1 || (netmask & ~ina.s_addr) != 0) {
option_error("invalid netmask value '%s'", *argv);
return (0);
}
struct in_addr ina;
struct hostent *hp;
- if (inet_aton(*argv, &ina) == 0) {
+ if (inet_pton(AF_INET, *argv, &ina) != 1) {
if ((hp = gethostbyname(*argv)) == NULL) {
option_error("invalid address parameter '%s' for ms-dns option",
*argv);
struct in_addr ina;
struct hostent *hp;
- if (inet_aton(*argv, &ina) == 0) {
+ if (inet_pton(AF_INET, *argv, &ina) != 1) {
if ((hp = gethostbyname(*argv)) == NULL) {
option_error("invalid address parameter '%s' for ms-wins option",
*argv);