From ba66ece34d50e80502a57c48634d58682ac71250 Mon Sep 17 00:00:00 2001 From: Kozlov Dmitry Date: Fri, 8 Oct 2010 13:01:25 +0400 Subject: pppoe: changed cookie generation procedure (due to connection problem from windows) updated documentation --- accel-pptpd/accel-pptp.conf | 5 +++++ accel-pptpd/accel-pptp.conf.5 | 17 +++++++++++++++++ accel-pptpd/ctrl/pppoe.c | 8 +++----- 3 files changed, 25 insertions(+), 5 deletions(-) diff --git a/accel-pptpd/accel-pptp.conf b/accel-pptpd/accel-pptp.conf index 62c0f897..8ca7c618 100644 --- a/accel-pptpd/accel-pptp.conf +++ b/accel-pptpd/accel-pptp.conf @@ -3,6 +3,7 @@ log_file #log_pgsql pptp +#pppoe auth_pap auth_chap_md5 auth_mschap_v1 @@ -30,6 +31,10 @@ echo-failure=3 echo-interval=30 verbose=1 +[pppoe] +interface=eth0 +verbose=1 + [dns] #dns1=172.16.0.1 #dns2=172.16.1.1 diff --git a/accel-pptpd/accel-pptp.conf.5 b/accel-pptpd/accel-pptp.conf.5 index a983c7c9..c630ac17 100644 --- a/accel-pptpd/accel-pptp.conf.5 +++ b/accel-pptpd/accel-pptp.conf.5 @@ -36,6 +36,10 @@ This is logging target which logs messages to PostgreSQL. .br PPTP controlling connection handling module. .TP +.BI pppoe +.br +PPPoE discovery stage handling module. +.TP .BI auth_pap PAP authentication module. .TP @@ -139,6 +143,19 @@ Specifies maximum number of echo-requests may be sent without valid echo-reply, .BI "timeout=" n Timeout waiting reply from client in seconds (default 5). .TP +.SH [pppoe] +.br +Configuration of PPPoE module. +.TP +.BI "interface=" ethX +Specifies interface name to listen/send discovery packets. You may specify multiple +.B interface +options. +.TP +.BI "verbose=" n +If this option is given and +.B n +is greater of zero then pppoe module will produce verbose logging. .SH [radius] .br Configuration of RADIUS module. diff --git a/accel-pptpd/ctrl/pppoe.c b/accel-pptpd/ctrl/pppoe.c index 7a9616a2..d59a3174 100644 --- a/accel-pptpd/ctrl/pppoe.c +++ b/accel-pptpd/ctrl/pppoe.c @@ -336,7 +336,7 @@ static void print_packet(uint8_t *pack) log_info("]\n"); } -static void generate_cookie(const uint8_t *src, const uint8_t *dst, const struct pppoe_tag *host_uniq, uint8_t *cookie) +static void generate_cookie(const uint8_t *src, const uint8_t *dst, uint8_t *cookie) { MD5_CTX ctx; @@ -344,8 +344,6 @@ static void generate_cookie(const uint8_t *src, const uint8_t *dst, const struct MD5_Update(&ctx, secret, SECRET_SIZE); MD5_Update(&ctx, src, ETH_ALEN); MD5_Update(&ctx, dst, ETH_ALEN); - if (host_uniq) - MD5_Update(&ctx, host_uniq->tag_data, ntohs(host_uniq->tag_len)); MD5_Update(&ctx, conf_ac_name, strlen(conf_ac_name)); MD5_Update(&ctx, secret, SECRET_SIZE); MD5_Final(cookie, &ctx); @@ -413,7 +411,7 @@ static void pppoe_send_PADO(struct pppoe_serv_t *serv, const uint8_t *addr, cons add_tag(pack, TAG_AC_NAME, (uint8_t *)conf_ac_name, strlen(conf_ac_name)); add_tag(pack, TAG_SERVICE_NAME, (uint8_t *)conf_service_name, strlen(conf_service_name)); - generate_cookie(serv->hwaddr, addr, host_uniq, cookie); + generate_cookie(serv->hwaddr, addr, cookie); add_tag(pack, TAG_AC_COOKIE, cookie, MD5_DIGEST_LENGTH); if (host_uniq) @@ -621,7 +619,7 @@ static void pppoe_recv_PADR(struct pppoe_serv_t *serv, uint8_t *pack, int size) return; } - generate_cookie(serv->hwaddr, ethhdr->h_source, host_uniq_tag, cookie); + generate_cookie(serv->hwaddr, ethhdr->h_source, cookie); if (memcmp(cookie, ac_cookie_tag->tag_data, MD5_DIGEST_LENGTH)) { if (conf_verbose) -- cgit v1.2.3