diff options
| author | Kozlov Dmitry <dima@server> | 2010-12-07 16:24:47 +0300 |
|---|---|---|
| committer | Kozlov Dmitry <dima@server> | 2010-12-07 16:24:47 +0300 |
| commit | 30924d602d0ec52afaaff4e29ff385e2a8c7be93 (patch) | |
| tree | cefb9488d7da91f8dd31471516a4a49ca041e2f4 /accel-pptpd/ppp | |
| parent | b88670c92455455e747ca683dd9ab6e7fd5d26f4 (diff) | |
| download | accel-ppp-30924d602d0ec52afaaff4e29ff385e2a8c7be93.tar.gz accel-ppp-30924d602d0ec52afaaff4e29ff385e2a8c7be93.zip | |
ppp: implemented sid-case option to specify in which case generate session identifier
Diffstat (limited to 'accel-pptpd/ppp')
| -rw-r--r-- | accel-pptpd/ppp/ppp.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/accel-pptpd/ppp/ppp.c b/accel-pptpd/ppp/ppp.c index f8faed8f..f5abbab7 100644 --- a/accel-pptpd/ppp/ppp.c +++ b/accel-pptpd/ppp/ppp.c @@ -24,6 +24,7 @@ #include "memdebug.h" int __export conf_ppp_verbose; +static int conf_sid_ucase; pthread_rwlock_t __export ppp_lock = PTHREAD_RWLOCK_INITIALIZER; __export LIST_HEAD(ppp_list); @@ -84,7 +85,10 @@ static void generate_sessionid(struct ppp_t *ppp) sid = __sync_add_and_fetch(&seq, 1); #endif - sprintf(ppp->sessionid, "%016llx", sid); + if (conf_sid_ucase) + sprintf(ppp->sessionid, "%016llX", sid); + else + sprintf(ppp->sessionid, "%016llx", sid); } int __export establish_ppp(struct ppp_t *ppp) @@ -635,6 +639,14 @@ static void __init init(void) if (opt && atoi(opt) > 0) conf_ppp_verbose = 1; + opt = conf_get_opt("ppp", "sid-case"); + if (opt) { + if (!strcmp(opt, "upper")) + conf_sid_ucase = 1; + else if (strcmp(opt, "lower")) + log_emerg("ppp: sid-case: invalid format\n"); + } + opt = conf_get_opt("ppp", "seq-file"); if (!opt) opt = "/var/run/accel-pptp/seq"; |
