summaryrefslogtreecommitdiffstats
path: root/gatchat/ppp_cp.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/ppp_cp.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/ppp_cp.c')
-rw-r--r--gatchat/ppp_cp.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/gatchat/ppp_cp.c b/gatchat/ppp_cp.c
index 00acb73b..e152f6ef 100644
--- a/gatchat/ppp_cp.c
+++ b/gatchat/ppp_cp.c
@@ -61,10 +61,8 @@ static const char *pppcp_event_strings[] = {
g_free(str); \
} while (0);
-#define PPP_HEADROOM 2
-
#define pppcp_to_ppp_packet(p) \
- (((guint8 *) p) - PPP_HEADROOM)
+ (((guint8 *) p) - sizeof(struct ppp_header))
#define INITIAL_RESTART_TIMEOUT 3 /* restart interval in seconds */
#define MAX_TERMINATE 2
@@ -206,7 +204,7 @@ static struct pppcp_packet *pppcp_packet_new(struct pppcp_data *data,
struct ppp_header *ppp_packet;
guint16 packet_length = bufferlen + sizeof(*packet);
- ppp_packet = g_try_malloc0(packet_length + 2);
+ ppp_packet = g_try_malloc0(packet_length + sizeof(*ppp_packet));
if (!ppp_packet)
return NULL;