summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/npppd/npppd/npppd_auth.c12
-rw-r--r--usr.sbin/npppd/npppd/parse.y5
2 files changed, 13 insertions, 4 deletions
diff --git a/usr.sbin/npppd/npppd/npppd_auth.c b/usr.sbin/npppd/npppd/npppd_auth.c
index d75fb45b204..778c2c4f227 100644
--- a/usr.sbin/npppd/npppd/npppd_auth.c
+++ b/usr.sbin/npppd/npppd/npppd_auth.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: npppd_auth.c,v 1.11 2012/09/22 20:22:48 espie Exp $ */
+/* $OpenBSD: npppd_auth.c,v 1.12 2013/01/31 09:44:21 yasuoka Exp $ */
/*-
* Copyright (c) 2009 Internet Initiative Japan Inc.
@@ -26,7 +26,7 @@
* SUCH DAMAGE.
*/
/**@file authentication realm */
-/* $Id: npppd_auth.c,v 1.11 2012/09/22 20:22:48 espie Exp $ */
+/* $Id: npppd_auth.c,v 1.12 2013/01/31 09:44:21 yasuoka Exp $ */
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/socket.h>
@@ -561,6 +561,10 @@ npppd_auth_radius_reload(npppd_auth_base *base, struct authconf *auth)
break;
memcpy(&rad->server[i].peer, &server->address,
server->address.ss_len);
+ if (((struct sockaddr_in *)&rad->server[i].peer)->sin_port
+ == 0)
+ ((struct sockaddr_in *)&rad->server[i].peer)->sin_port
+ = htons(DEFAULT_RADIUS_AUTH_PORT);
strlcpy(rad->server[i].secret, server->secret,
sizeof(rad->server[i].secret));
rad->server[i].enabled = 1;
@@ -578,6 +582,10 @@ npppd_auth_radius_reload(npppd_auth_base *base, struct authconf *auth)
break;
memcpy(&rad->server[i].peer, &server->address,
server->address.ss_len);
+ if (((struct sockaddr_in *)&rad->server[i].peer)->sin_port
+ == 0)
+ ((struct sockaddr_in *)&rad->server[i].peer)->sin_port
+ = htons(DEFAULT_RADIUS_ACCT_PORT);
strlcpy(rad->server[i].secret, server->secret,
sizeof(rad->server[i].secret));
rad->server[i].enabled = 1;
diff --git a/usr.sbin/npppd/npppd/parse.y b/usr.sbin/npppd/npppd/parse.y
index b05627b92d7..8c0507a568f 100644
--- a/usr.sbin/npppd/npppd/parse.y
+++ b/usr.sbin/npppd/npppd/parse.y
@@ -1,4 +1,4 @@
-/* $OpenBSD: parse.y,v 1.3 2012/11/13 17:10:40 yasuoka Exp $ */
+/* $OpenBSD: parse.y,v 1.4 2013/01/31 09:44:21 yasuoka Exp $ */
/*
* Copyright (c) 2002, 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -677,7 +677,8 @@ radopt : ADDRESS address optport SECRET STRING {
YYERROR;
}
n->address = $2;
- ((struct sockaddr_in *)&n->address)->sin_port = $3;
+ ((struct sockaddr_in *)&n->address)->sin_port =
+ htons($3);
n->secret = $5;
TAILQ_INSERT_TAIL(&curr_radconf->servers, n, entry);
}