From 227298572c50013225752ff3af13ffc724d26ddf Mon Sep 17 00:00:00 2001 From: root Date: Thu, 11 Oct 2012 16:46:16 +0200 Subject: move 'comp' field from struct ppp_t to struct ap_session MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Conflicts: accel-pppd/ctrl/openvpn/openvpn.c --- accel-pppd/cli/show_sessions.c | 11 ++--------- accel-pppd/include/ap_session.h | 4 +++- accel-pppd/ppp/ccp_mppe.c | 4 ++-- accel-pppd/ppp/ppp.h | 1 - 4 files changed, 7 insertions(+), 13 deletions(-) (limited to 'accel-pppd') diff --git a/accel-pppd/cli/show_sessions.c b/accel-pppd/cli/show_sessions.c index fe202980..9e0ad2fb 100644 --- a/accel-pppd/cli/show_sessions.c +++ b/accel-pppd/cli/show_sessions.c @@ -452,15 +452,8 @@ static void print_sid(const struct ap_session *ses, char *buf) static void print_comp(const struct ap_session *ses, char *buf) { - struct ppp_t *ppp; - - *buf = 0; - - if (ses->ctrl->ppp) { - ppp = container_of(ses, typeof(*ppp), ses); - if (ppp->comp) - snprintf(buf, CELL_SIZE, "%s", ppp->comp); - } + if (ses->comp) + snprintf(buf, CELL_SIZE, "%s", ses->comp); } static void init(void) diff --git a/accel-pppd/include/ap_session.h b/accel-pppd/include/ap_session.h index 82654f8b..6845ca90 100644 --- a/accel-pppd/include/ap_session.h +++ b/accel-pppd/include/ap_session.h @@ -78,7 +78,9 @@ struct ap_session char *ipv4_pool_name; char *ipv6_pool_name; - struct ap_ctrl *ctrl; + const struct ap_ctrl *ctrl; + + const char *comp; #ifdef USE_BACKUP struct backup_data *backup; diff --git a/accel-pppd/ppp/ccp_mppe.c b/accel-pppd/ppp/ccp_mppe.c index b24690be..68b95a6b 100644 --- a/accel-pppd/ppp/ccp_mppe.c +++ b/accel-pppd/ppp/ccp_mppe.c @@ -220,9 +220,9 @@ static int mppe_recv_conf_req(struct ppp_ccp_t *ccp, struct ccp_option_t *opt, u } log_ppp_debug(" (mppe enabled)"); - ccp->ppp->comp = "mppe"; + ccp->ppp->ses.comp = "mppe"; } else - ccp->ppp->comp = NULL; + ccp->ppp->ses.comp = NULL; return CCP_OPT_ACK; } diff --git a/accel-pppd/ppp/ppp.h b/accel-pppd/ppp/ppp.h index f5e0922a..f07e0282 100644 --- a/accel-pppd/ppp/ppp.h +++ b/accel-pppd/ppp/ppp.h @@ -64,7 +64,6 @@ struct ppp_t struct list_head layers; - const char *comp; struct ppp_lcp_t *lcp; }; -- cgit v1.2.3