From 3fff4c49c8de500a6355e012c7246890368b2cb7 Mon Sep 17 00:00:00 2001 From: Kristen Carlson Accardi Date: Thu, 13 May 2010 10:31:32 -0700 Subject: ppp: implement ppp_packet_new --- gatchat/ppp_auth.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'gatchat/ppp_auth.c') diff --git a/gatchat/ppp_auth.c b/gatchat/ppp_auth.c index eae5d17a..d26b764e 100644 --- a/gatchat/ppp_auth.c +++ b/gatchat/ppp_auth.c @@ -83,12 +83,10 @@ static void chap_process_challenge(struct ppp_chap *chap, const guint8 *packet) */ digest_len = g_checksum_type_get_length(chap->method); response_length = digest_len + sizeof(*header) + 1; - ppp_packet = g_try_malloc0(response_length + sizeof(struct ppp_header)); + ppp_packet = ppp_packet_new(response_length, CHAP_PROTOCOL); if (!ppp_packet) goto challenge_out; - /* add our protocol information */ - ppp_packet->proto = htons(CHAP_PROTOCOL); response = (struct chap_header *) &ppp_packet->info; if (response) { response->code = RESPONSE; -- cgit v1.2.3