From: Kristen Carlson Accardi <kristen@linux.intel.com>
To: ofono@ofono.org
Subject: [PATCH] ppp: don't bother with magic number
Date: Fri, 09 Apr 2010 07:54:09 -0700 [thread overview]
Message-ID: <1270824849-6799-1-git-send-email-kristen@linux.intel.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 2418 bytes --]
Commit to not supporting loop back detection. Because we never negotiate
a magic number locally, we can't reliably detect it. Just accept peer's
magic number option, but don't bother storing it.
---
gatchat/ppp_cp.c | 8 +++++++-
gatchat/ppp_lcp.c | 6 +-----
2 files changed, 8 insertions(+), 6 deletions(-)
diff --git a/gatchat/ppp_cp.c b/gatchat/ppp_cp.c
index 5ac0196..af6445f 100644
--- a/gatchat/ppp_cp.c
+++ b/gatchat/ppp_cp.c
@@ -574,7 +574,7 @@ static void pppcp_send_echo_reply(struct pppcp_data *data,
*/
packet->identifier = header->identifier;
- /* magic number? */
+ /* magic number will always be zero */
ppp_transmit(data->ppp, pppcp_to_ppp_packet(packet),
ntohs(packet->length));
@@ -855,6 +855,12 @@ static guint8 pppcp_process_protocol_reject(struct pppcp_data *data,
return RXJ_MINUS;
}
+/*
+ * For Echo-Request, Echo-Reply, and Discard-Request, we will not
+ * bother checking the magic number of the packet, because we will
+ * never send an echo or discard request. We can't reliably detect
+ * loop back anyway since we don't negotiate a magic number.
+ */
static guint8 pppcp_process_echo_request(struct pppcp_data *data,
struct pppcp_packet *packet)
{
diff --git a/gatchat/ppp_lcp.c b/gatchat/ppp_lcp.c
index a384a0d..5dfe4aa 100644
--- a/gatchat/ppp_lcp.c
+++ b/gatchat/ppp_lcp.c
@@ -64,7 +64,6 @@ enum lcp_options {
#define REQ_OPTION_ACCM 0x1
struct lcp_data {
- guint32 magic_number;
guint8 options[MAX_CONFIG_OPTION_SIZE];
guint16 options_len;
guint8 req_options;
@@ -157,7 +156,6 @@ static enum rcr_result lcp_rcr(struct pppcp_data *pppcp,
const struct pppcp_packet *packet,
guint8 **new_options, guint16 *new_len)
{
- struct lcp_data *lcp = pppcp_get_data(pppcp);
GAtPPP *ppp = pppcp_get_ppp(pppcp);
struct ppp_option_iter iter;
@@ -180,7 +178,6 @@ static enum rcr_result lcp_rcr(struct pppcp_data *pppcp,
if (magic == 0)
return RCR_REJECT;
- /* TODO: Handle loopback */
break;
}
default:
@@ -201,8 +198,7 @@ static enum rcr_result lcp_rcr(struct pppcp_data *pppcp,
ppp_set_auth(ppp, ppp_option_iter_get_data(&iter));
break;
case MAGIC_NUMBER:
- lcp->magic_number =
- get_host_long(ppp_option_iter_get_data(&iter));
+ /* don't care */
break;
case PFC:
ppp_set_pfc(ppp, TRUE);
--
1.6.6.1
reply other threads:[~2010-04-09 14:54 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1270824849-6799-1-git-send-email-kristen@linux.intel.com \
--to=kristen@linux.intel.com \
--cc=ofono@ofono.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox