summaryrefslogtreecommitdiffstats
path: root/gatchat/gatppp.c
diff options
context:
space:
mode:
Diffstat (limited to 'gatchat/gatppp.c')
-rw-r--r--gatchat/gatppp.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/gatchat/gatppp.c b/gatchat/gatppp.c
index 1547a753..c7bf089b 100644
--- a/gatchat/gatppp.c
+++ b/gatchat/gatppp.c
@@ -124,6 +124,7 @@ static struct frame_buffer *ppp_encode(GAtPPP *ppp, guint8 *data, int len)
int i = 0;
guint16 fcs = PPPINITFCS16;
guint16 proto = get_host_short(data);
+ guint8 code;
gboolean lcp = (proto == LCP_PROTOCOL);
guint8 *frame;
struct frame_buffer *fb =
@@ -133,6 +134,15 @@ static struct frame_buffer *ppp_encode(GAtPPP *ppp, guint8 *data, int len)
return NULL;
frame = fb->bytes;
+ /*
+ * all LCP Link Configuration, Link Termination, and Code-Reject
+ * packets must be sent with the default sending ACCM
+ */
+ if (lcp) {
+ code = pppcp_get_code(data);
+ lcp = code > 0 && code < 8;
+ }
+
/* copy in the HDLC framing */
frame[pos++] = PPP_FLAG_SEQ;