From 8a357b3face42594953828dc76584a54c23c0296 Mon Sep 17 00:00:00 2001 From: Daniel Lenski Date: Fri, 15 May 2020 08:34:03 -0700 Subject: [PATCH] suppress warnings Signed-off-by: Daniel Lenski --- ppp.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/ppp.c b/ppp.c index 7ee0e969..6bcb8a06 100644 --- a/ppp.c +++ b/ppp.c @@ -696,16 +696,16 @@ static int handle_state_transition(struct openconnect_info *vpninfo, int *timeou } static inline void add_ppp_header(struct pkt *p, struct oc_ppp *ppp, int proto) { - int n = 0; + unsigned char *ph = p->data; /* XX: store PPP header, in reverse */ - p->data[--n] = proto & 0xff; + *--ph = proto & 0xff; if (proto > 0xff || !(ppp->out_lcp_opts & BIT_PFCOMP)) - p->data[--n] = proto >> 8; + *--ph = proto >> 8; if (proto == PPP_LCP || !(ppp->out_lcp_opts & BIT_ACCOMP)) { - p->data[--n] = 0x03; /* Control */ - p->data[--n] = 0xff; /* Address */ + *--ph = 0x03; /* Control */ + *--ph = 0xff; /* Address */ } - p->ppp.hlen = -n; + p->ppp.hlen = p->data - ph; } int ppp_mainloop(struct openconnect_info *vpninfo, int *timeout, int readable) -- 2.49.0