From e4893b58b07bd0663e63e48ac74efd9e4763a11a Mon Sep 17 00:00:00 2001 From: aland Date: Wed, 3 May 2006 17:38:51 +0000 Subject: [PATCH] Allow 0x... for abinary --- src/lib/valuepair.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/lib/valuepair.c b/src/lib/valuepair.c index 66a1d93..8e41a70 100644 --- a/src/lib/valuepair.c +++ b/src/lib/valuepair.c @@ -806,26 +806,29 @@ VALUE_PAIR *pairparsevalue(VALUE_PAIR *vp, const char *value) break; case PW_TYPE_ABINARY: #ifdef ASCEND_BINARY - /* - * Special case to convert filter to binary - */ - strNcpy(vp->vp_strvalue, value, sizeof(vp->vp_strvalue)); + if (strncasecmp(value, "0x", 2) == 0) { + vp->type = PW_TYPE_OCTETS; + goto do_octets; + } + if (ascend_parse_filter(vp) < 0 ) { librad_log("failed to parse Ascend binary attribute: %s", librad_errstr); return NULL; } break; + /* * If Ascend binary is NOT defined, * then fall through to raw octets, so that * the user can at least make them by hand... */ + do_octets: #endif /* raw octets: 0x01020304... */ case PW_TYPE_OCTETS: if (strncasecmp(value, "0x", 2) == 0) { - u_char *us; + uint8_t *us; cp = value + 2; us = vp->vp_strvalue; vp->length = 0; -- 2.1.4