From c26447d9227c2ffe6f45e3ef83f0dbfca78bb0a2 Mon Sep 17 00:00:00 2001 From: Denis Kenzior Date: Fri, 9 Apr 2010 08:44:29 -0500 Subject: [PATCH] ppp: Use flags instead of booleans for lcp options --- gatchat/ppp_lcp.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/gatchat/ppp_lcp.c b/gatchat/ppp_lcp.c index 9b771ef..a384a0d 100644 --- a/gatchat/ppp_lcp.c +++ b/gatchat/ppp_lcp.c @@ -61,11 +61,13 @@ enum lcp_options { /* Maximum size of all options, we only ever request ACCM */ #define MAX_CONFIG_OPTION_SIZE 6 +#define REQ_OPTION_ACCM 0x1 + struct lcp_data { guint32 magic_number; guint8 options[MAX_CONFIG_OPTION_SIZE]; guint16 options_len; - gboolean req_accm; /* Should we request ACCM */ + guint8 req_options; guint32 accm; /* ACCM value */ }; @@ -73,7 +75,7 @@ static void lcp_generate_config_options(struct lcp_data *lcp) { guint16 len = 0; - if (lcp->req_accm) { + if (lcp->req_options & REQ_OPTION_ACCM) { guint32 accm; accm = htonl(lcp->accm); @@ -280,7 +282,7 @@ struct pppcp_data *lcp_new(GAtPPP *ppp) pppcp_set_data(pppcp, lcp); - lcp->req_accm = TRUE; + lcp->req_options = REQ_OPTION_ACCM; lcp->accm = 0; lcp_generate_config_options(lcp); -- 2.7.4