summaryrefslogtreecommitdiffstats
path: root/gatchat/gatppp.c
diff options
context:
space:
mode:
authorKristen Carlson Accardi <kristen@linux.intel.com>2010-04-26 10:28:41 -0700
committerDenis Kenzior <denkenz@gmail.com>2010-04-26 12:38:31 -0500
commitfce78feb549ccaad55cf3943391b2cad9a4b6646 (patch)
treebbfae1f6ac8e85b5c4d8aed4a0f2bac84daba86f /gatchat/gatppp.c
parent30644d81957cfefe99df5789ad2f65683123a4cd (diff)
downloadofono-fce78feb549ccaad55cf3943391b2cad9a4b6646.tar.bz2
ppp: discard non-LCP packets in ESTABLISHMENT phase
Diffstat (limited to 'gatchat/gatppp.c')
-rw-r--r--gatchat/gatppp.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/gatchat/gatppp.c b/gatchat/gatppp.c
index fc6769c3..1547a753 100644
--- a/gatchat/gatppp.c
+++ b/gatchat/gatppp.c
@@ -169,6 +169,13 @@ static void ppp_recv(GAtPPP *ppp, struct frame_buffer *frame)
guint16 protocol = ppp_proto(frame->bytes);
guint8 *packet = ppp_info(frame->bytes);
+ /*
+ * Any non-LCP packets received during Link Establishment
+ * phase must be silently discarded.
+ */
+ if (ppp->phase == PPP_PHASE_ESTABLISHMENT && protocol != LCP_PROTOCOL)
+ return;
+
switch (protocol) {
case PPP_IP_PROTO:
/* If network is up & open, process the packet, if not, drop */