From 017c749648a91571b23824a689f2e3fdfe8c9d7e Mon Sep 17 00:00:00 2001 From: Dmitry Kozlov Date: Wed, 20 Dec 2017 13:11:15 +0300 Subject: shaper: define UINT16_MAX if not set --- accel-pppd/ctrl/pppoe/pppoe.c | 4 ++-- 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 4f99354..11a6ea1 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 cb85cc4..e38b579 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, -- cgit v1.2.3