diff options
Diffstat (limited to 'accel-pppd/ctrl/pppoe/pppoe.c')
-rw-r--r-- | accel-pppd/ctrl/pppoe/pppoe.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/accel-pppd/ctrl/pppoe/pppoe.c b/accel-pppd/ctrl/pppoe/pppoe.c index 59d9f4f3..78cc64a0 100644 --- a/accel-pppd/ctrl/pppoe/pppoe.c +++ b/accel-pppd/ctrl/pppoe/pppoe.c @@ -201,6 +201,7 @@ static void disconnect(struct pppoe_conn_t *conn) sid_map[conn->sid/(8*sizeof(long))] |= 1 << (conn->sid % (8*sizeof(long))); pthread_mutex_unlock(&sid_lock); + _free(conn->ctrl.service_name); _free(conn->ctrl.calling_station_id); _free(conn->ctrl.called_station_id); _free(conn->service_name); @@ -389,6 +390,12 @@ static struct pppoe_conn_t *allocate_channel(struct pppoe_serv_t *serv, const ui conn->ctrl.calling_station_id = _malloc(IFNAMSIZ + 19); + conn->ctrl.service_name = _malloc(256); + memset(conn->ctrl.service_name, 0x0, 256); + + if (service_name && ntohs(service_name->tag_len) < 256 && ntohs(service_name->tag_len) > 0) + memcpy(conn->ctrl.service_name, service_name->tag_data, ntohs(service_name->tag_len)); + if (conf_ifname_in_sid == 1 || conf_ifname_in_sid == 3) if (conf_sid_uppercase) sprintf(conn->ctrl.calling_station_id, "%s:%02X:%02X:%02X:%02X:%02X:%02X", serv->ifname, |