From baaa6b9ace4ef876739b74eac92d8a330517f7e8 Mon Sep 17 00:00:00 2001 From: yasuoka Date: Wed, 25 Jul 2018 02:18:36 +0000 Subject: [PATCH] Fix the prefix length of the IP address in the error message which shows failure of assigning requested IP address on IPCP, it was mistakenly "-1" on little endians. Found by IIJ. --- usr.sbin/npppd/npppd/npppd.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/usr.sbin/npppd/npppd/npppd.c b/usr.sbin/npppd/npppd/npppd.c index 7f474030869..a60c3bc8f01 100644 --- a/usr.sbin/npppd/npppd/npppd.c +++ b/usr.sbin/npppd/npppd/npppd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: npppd.c,v 1.47 2017/08/12 11:20:34 goda Exp $ */ +/* $OpenBSD: npppd.c,v 1.48 2018/07/25 02:18:36 yasuoka Exp $ */ /*- * Copyright (c) 2005-2008,2009 Internet Initiative Japan Inc. @@ -29,7 +29,7 @@ * Next pppd(nppd). This file provides a npppd daemon process and operations * for npppd instance. * @author Yasuoka Masahiko - * $Id: npppd.c,v 1.47 2017/08/12 11:20:34 goda Exp $ + * $Id: npppd.c,v 1.48 2018/07/25 02:18:36 yasuoka Exp $ */ #include "version.h" #include /* ALIGNED_POINTER */ @@ -1661,7 +1661,7 @@ npppd_assign_ip_addr(npppd *_this, npppd_ppp *ppp, uint32_t req_ip4) ppp_log(ppp, LOG_NOTICE, "Requested IP address (%d.%d.%d.%d)/%d " "is %s", IP_4OCT(req_ip4), - netmask2prefixlen(htonl(ip4mask)), reason); + netmask2prefixlen(ip4mask), reason); if (fallback_dyna) goto dyna_assign; return 1; -- 2.20.1