summaryrefslogtreecommitdiffstats
path: root/gatchat/ppp_cp.c
diff options
context:
space:
mode:
Diffstat (limited to 'gatchat/ppp_cp.c')
-rw-r--r--gatchat/ppp_cp.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/gatchat/ppp_cp.c b/gatchat/ppp_cp.c
index e152f6ef..bade6bbe 100644
--- a/gatchat/ppp_cp.c
+++ b/gatchat/ppp_cp.c
@@ -204,13 +204,10 @@ 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 + sizeof(*ppp_packet));
+ ppp_packet = ppp_packet_new(packet_length, data->driver->proto);
if (!ppp_packet)
return NULL;
- /* add our protocol information */
- ppp_packet->proto = htons(data->driver->proto);
-
/* advance past protocol to add CP header information */
packet = (struct pppcp_packet *) (ppp_packet->info);