summaryrefslogtreecommitdiff
path: root/accel-pppd/ctrl/pppoe/pppoe.c
diff options
context:
space:
mode:
authorDmitriyEshenko <snooppy@mail.ua>2021-04-23 12:40:05 +0300
committerDmitriyEshenko <snooppy@mail.ua>2021-04-23 12:40:05 +0300
commitfc19705d6198ffea39e31306c9d92c7180a2af43 (patch)
tree8d9575c8a63e7519b21855ae1bb629b549a0c28a /accel-pppd/ctrl/pppoe/pppoe.c
parent3b74e1088af7b525880b386136c0330bbed377a0 (diff)
downloadaccel-ppp-fc19705d6198ffea39e31306c9d92c7180a2af43.tar.gz
accel-ppp-fc19705d6198ffea39e31306c9d92c7180a2af43.zip
Add accept-blank-service option
Diffstat (limited to 'accel-pppd/ctrl/pppoe/pppoe.c')
-rw-r--r--accel-pppd/ctrl/pppoe/pppoe.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/accel-pppd/ctrl/pppoe/pppoe.c b/accel-pppd/ctrl/pppoe/pppoe.c
index 18aac8bd..415dd7c0 100644
--- a/accel-pppd/ctrl/pppoe/pppoe.c
+++ b/accel-pppd/ctrl/pppoe/pppoe.c
@@ -90,6 +90,7 @@ struct iplink_arg {
int conf_verbose;
char *conf_service_name[255];
int conf_accept_any_service;
+int conf_accept_blank_service;
char *conf_ac_name;
int conf_ifname_in_sid;
char *conf_pado_delay;
@@ -1003,7 +1004,11 @@ 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[0]) {
+ if (tag->tag_len == 0 && conf_accept_blank_service) {
+ service_match = 1;
+ break;
+ }
+ else if (conf_service_name[0]) {
int svc_index = 0;
do {
if (ntohs(tag->tag_len) == strlen(conf_service_name[svc_index]) &&
@@ -1949,6 +1954,10 @@ static void load_config(void)
if (opt)
conf_accept_any_service = atoi(opt);
+ opt = conf_get_opt("pppoe", "accept-blank-service");
+ if (opt)
+ conf_accept_blank_service = atoi(opt);
+
opt = conf_get_opt("pppoe", "ac-name");
if (!opt)
opt = conf_get_opt("pppoe", "AC-Name");