summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitry Kozlov <xeb@mail.ru>2015-06-16 00:43:27 +0300
committerDmitry Kozlov <xeb@mail.ru>2015-06-16 00:43:27 +0300
commit75edc5199bfcf7c83079b58990760f3de57680ec (patch)
tree1c339719039b7cbd1e769b2ddfbcfe5f49057bc5
parentb8b91d8b087312c91a9941dacd11a98692679ec8 (diff)
downloadaccel-ppp-75edc5199bfcf7c83079b58990760f3de57680ec.tar.gz
accel-ppp-75edc5199bfcf7c83079b58990760f3de57680ec.zip
pppoe: do not send reply if Service-Name is empty
-rw-r--r--accel-pppd/ctrl/pppoe/pppoe.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/accel-pppd/ctrl/pppoe/pppoe.c b/accel-pppd/ctrl/pppoe/pppoe.c
index 092f0f3..3f23ebc 100644
--- a/accel-pppd/ctrl/pppoe/pppoe.c
+++ b/accel-pppd/ctrl/pppoe/pppoe.c
@@ -880,7 +880,7 @@ static void pppoe_recv_PADI(struct pppoe_serv_t *serv, uint8_t *pack, int size)
struct pppoe_tag *host_uniq_tag = NULL;
struct pppoe_tag *relay_sid_tag = NULL;
struct pppoe_tag *service_name_tag = NULL;
- int len, n, service_match = 0;
+ int len, n, service_match = conf_service_name == NULL;
struct delayed_pado_t *pado;
struct timespec ts;
@@ -913,16 +913,14 @@ static void pppoe_recv_PADI(struct pppoe_serv_t *serv, uint8_t *pack, int size)
case TAG_END_OF_LIST:
break;
case TAG_SERVICE_NAME:
- if (conf_service_name && tag->tag_len) {
+ if (conf_service_name) {
if (ntohs(tag->tag_len) != strlen(conf_service_name))
break;
if (memcmp(tag->tag_data, conf_service_name, ntohs(tag->tag_len)))
break;
service_match = 1;
- } else {
+ } else
service_name_tag = tag;
- service_match = 1;
- }
break;
case TAG_HOST_UNIQ:
host_uniq_tag = tag;