summaryrefslogtreecommitdiff
path: root/pppd
diff options
context:
space:
mode:
authorDavid F. Skoll <dfs@roaringpenguin.com>2002-03-01 15:16:51 +0000
committerDavid F. Skoll <dfs@roaringpenguin.com>2002-03-01 15:16:51 +0000
commit8832e3ba208085ae3f15c0d48c2bb7a02bc9ae79 (patch)
treebf06293a0390e81899746c421d1a1d585eb54c97 /pppd
parentc062322f9e8757b85a3c2281a3190d8af14bcd9b (diff)
downloadppp-8832e3ba208085ae3f15c0d48c2bb7a02bc9ae79.tar.gz
Check for vendor code before trying to interpret RADIUS attributes.
Diffstat (limited to 'pppd')
-rw-r--r--pppd/plugins/radius/radius.c75
1 files changed, 38 insertions, 37 deletions
diff --git a/pppd/plugins/radius/radius.c b/pppd/plugins/radius/radius.c
index c192bbb..fa638d0 100644
--- a/pppd/plugins/radius/radius.c
+++ b/pppd/plugins/radius/radius.c
@@ -21,7 +21,7 @@
*
***********************************************************************/
static char const RCSID[] =
-"$Id: radius.c,v 1.3 2002/03/01 14:39:18 dfs Exp $";
+"$Id: radius.c,v 1.4 2002/03/01 15:16:51 dfs Exp $";
#include "pppd.h"
#include "chap.h"
@@ -397,44 +397,46 @@ radius_setparams(VALUE_PAIR *vp, char *msg)
*/
while (vp) {
- switch (vp->attribute) {
- case PW_SERVICE_TYPE:
- /* check for service type */
- /* if not FRAMED then exit */
- if (vp->lvalue != PW_FRAMED) {
- slprintf(msg, BUF_LEN, "RADIUS: wrong service type %ld for %s",
- vp->lvalue, rstate.user);
- return -1;
- }
- break;
- case PW_FRAMED_PROTOCOL:
- /* check for framed protocol type */
- /* if not PPP then also exit */
- if (vp->lvalue != PW_PPP) {
- slprintf(msg, BUF_LEN, "RADIUS: wrong framed protocol %ld for %s",
- vp->lvalue, rstate.user);
- return -1;
- }
- break;
-
- case PW_FRAMED_IP_ADDRESS:
- /* seting up remote IP addresses */
- remote = vp->lvalue;
- if (remote == 0xffffffff) {
- /* 0xffffffff means user should be allowed to select one */
- rstate.any_ip_addr_ok = 1;
- } else if (remote != 0xfffffffe) {
- /* 0xfffffffe means NAS should select an ip address */
- remote = htonl(vp->lvalue);
- if (bad_ip_adrs (remote)) {
- slprintf(msg, BUF_LEN, "RADIUS: bad remote IP address %I for %s",
- remote, rstate.user);
+ if (vp->vendorcode == VENDOR_NONE) {
+ switch (vp->attribute) {
+ case PW_SERVICE_TYPE:
+ /* check for service type */
+ /* if not FRAMED then exit */
+ if (vp->lvalue != PW_FRAMED) {
+ slprintf(msg, BUF_LEN, "RADIUS: wrong service type %ld for %s",
+ vp->lvalue, rstate.user);
return -1;
}
- rstate.choose_ip = 1;
- rstate.ip_addr = remote;
- }
+ break;
+ case PW_FRAMED_PROTOCOL:
+ /* check for framed protocol type */
+ /* if not PPP then also exit */
+ if (vp->lvalue != PW_PPP) {
+ slprintf(msg, BUF_LEN, "RADIUS: wrong framed protocol %ld for %s",
+ vp->lvalue, rstate.user);
+ return -1;
+ }
+ break;
+
+ case PW_FRAMED_IP_ADDRESS:
+ /* seting up remote IP addresses */
+ remote = vp->lvalue;
+ if (remote == 0xffffffff) {
+ /* 0xffffffff means user should be allowed to select one */
+ rstate.any_ip_addr_ok = 1;
+ } else if (remote != 0xfffffffe) {
+ /* 0xfffffffe means NAS should select an ip address */
+ remote = htonl(vp->lvalue);
+ if (bad_ip_adrs (remote)) {
+ slprintf(msg, BUF_LEN, "RADIUS: bad remote IP address %I for %s",
+ remote, rstate.user);
+ return -1;
+ }
+ rstate.choose_ip = 1;
+ rstate.ip_addr = remote;
+ }
break;
+ }
}
vp = vp->next;
}
@@ -733,4 +735,3 @@ char *radius_logged_in_user(void)
{
return rstate.user;
}
-