diff options
author | Dmitry Kozlov <xeb@mail.ru> | 2017-12-20 13:11:15 +0300 |
---|---|---|
committer | Dmitry Kozlov <xeb@mail.ru> | 2017-12-20 13:11:15 +0300 |
commit | 017c749648a91571b23824a689f2e3fdfe8c9d7e (patch) | |
tree | d109aeefc34059f41ec26b6a27d2563e4636b0c3 | |
parent | 019f2c557d066070217a5cc873fd078bf3b6400d (diff) | |
download | accel-ppp-017c749648a91571b23824a689f2e3fdfe8c9d7e.tar.gz accel-ppp-017c749648a91571b23824a689f2e3fdfe8c9d7e.zip |
shaper: define UINT16_MAX if not set
-rw-r--r-- | accel-pppd/ctrl/pppoe/pppoe.c | 4 | ||||
-rw-r--r-- | accel-pppd/shaper/tc_core.h | 4 |
2 files changed, 6 insertions, 2 deletions
diff --git a/accel-pppd/ctrl/pppoe/pppoe.c b/accel-pppd/ctrl/pppoe/pppoe.c index 4f993542..11a6ea1f 100644 --- a/accel-pppd/ctrl/pppoe/pppoe.c +++ b/accel-pppd/ctrl/pppoe/pppoe.c @@ -989,7 +989,7 @@ static void pppoe_recv_PADI(struct pppoe_serv_t *serv, uint8_t *pack, int size) if (conf_service_name[0]) { int svc_index = 0; do { - if (ntohs(tag->tag_len) == strlen(conf_service_name[svc_index]) && + if (ntohs(tag->tag_len) == strlen(conf_service_name[svc_index]) && memcmp(tag->tag_data, conf_service_name[svc_index], ntohs(tag->tag_len)) == 0) { service_match = 1; break; @@ -1126,7 +1126,7 @@ static void pppoe_recv_PADR(struct pppoe_serv_t *serv, uint8_t *pack, int size) else if (conf_service_name[0]) { int svc_index = 0; do { - if (ntohs(tag->tag_len) == strlen(conf_service_name[svc_index]) && + if (ntohs(tag->tag_len) == strlen(conf_service_name[svc_index]) && memcmp(tag->tag_data, conf_service_name[svc_index], ntohs(tag->tag_len)) == 0) { service_match = 1; break; diff --git a/accel-pppd/shaper/tc_core.h b/accel-pppd/shaper/tc_core.h index cb85cc44..e38b5799 100644 --- a/accel-pppd/shaper/tc_core.h +++ b/accel-pppd/shaper/tc_core.h @@ -6,6 +6,10 @@ #define TIME_UNITS_PER_SEC 1000000 +#ifndef UINT16_MAX +#define UINT16_MAX 65535 +#endif + enum link_layer { LINKLAYER_UNSPEC, LINKLAYER_ETHERNET, |