summaryrefslogtreecommitdiffstats
path: root/gatchat/gatppp.c
diff options
context:
space:
mode:
authorKristen Carlson Accardi <kristen@linux.intel.com>2010-05-10 13:06:37 -0700
committerDenis Kenzior <denkenz@gmail.com>2010-05-10 16:27:15 -0500
commit125fc62526114acd373ed090edbd42a01300e2af (patch)
tree0b45feb0a6a2a05d6ebd1d724f5df073c6c09273 /gatchat/gatppp.c
parentf13d5e2badcd2ca277e895990e47bb49e1df81a3 (diff)
downloadofono-125fc62526114acd373ed090edbd42a01300e2af.tar.bz2
ppp: set address and control field
Before sending to hdlc, set the address and control field. Fix hardcode of ppp header size.
Diffstat (limited to 'gatchat/gatppp.c')
-rw-r--r--gatchat/gatppp.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/gatchat/gatppp.c b/gatchat/gatppp.c
index cb2fef98..d2c3d5a9 100644
--- a/gatchat/gatppp.c
+++ b/gatchat/gatppp.c
@@ -148,7 +148,8 @@ static void ppp_receive(const unsigned char *buf, gsize len, void *data)
*/
void ppp_transmit(GAtPPP *ppp, guint8 *packet, guint infolen)
{
- guint16 proto = get_host_short(packet);
+ struct ppp_header *header = (struct ppp_header *) packet;
+ guint16 proto = ppp_proto(packet);
guint8 code;
gboolean lcp = (proto == LCP_PROTOCOL);
guint32 xmit_accm = 0;
@@ -167,7 +168,11 @@ void ppp_transmit(GAtPPP *ppp, guint8 *packet, guint infolen)
g_at_hdlc_set_xmit_accm(ppp->hdlc, ~0U);
}
- if (g_at_hdlc_send(ppp->hdlc, packet, infolen + 2) == FALSE)
+ header->address = PPP_ADDR_FIELD;
+ header->control = PPP_CTRL;
+
+ if (g_at_hdlc_send(ppp->hdlc, packet,
+ infolen + sizeof(*header)) == FALSE)
g_print("Failed to send a frame\n");
if (lcp)