diff -u src-old/conf.h src/conf.h --- src-old/conf.h Wed Mar 8 04:12:21 2000 +++ src/conf.h Mon Jan 15 14:55:15 2001 @@ -36,7 +36,8 @@ Use at your own risk! -- dgreer@austintx.com */ -#define ASCEND_PORT_HACK +/* #define ASCEND_PORT_HACK */ +#define CISCO_PORT_HACK #define ASCEND_CHANNELS_PER_LINE 23 #define CISCO_ACCOUNTING_HACK diff -u src-old/files.c src/files.c --- src-old/files.c Tue Sep 5 20:14:00 2000 +++ src/files.c Mon Jan 15 15:08:26 2001 @@ -928,6 +928,24 @@ } #endif +#ifdef CISCO_PORT_HACK +/* + * hazard@hazard.maks.net: + * Cisco is not as weird as Ascend :-), but still, + * it sends port numbers using formula 20000+real_port_id if the + * call is ISDN. + * This hack subtracts it if needed so that "+" works for IP addresses. + */ + +static int cisco_port_number(int nas_port) +{ + if (nas_port >= 20000) { + nas_port -= 20000; + } + return nas_port; +} +#endif + /* * Find the named user in the database. Create the * set of attribute-value pairs to check and reply with @@ -1032,6 +1050,9 @@ */ #ifdef ASCEND_PORT_HACK nas_port = ascend_port_number(nas_port); +#endif +#ifdef CISCO_PORT_HACK + nas_port = cisco_port_number(nas_port); #endif tmp->lvalue += nas_port; }