From bb608827a3f1aa243916b1550f2353ab844a86c6 Mon Sep 17 00:00:00 2001 From: Guillaume Nault Date: Wed, 13 Feb 2013 13:50:22 +0100 Subject: l2tp: Fix Result Code AVP byte order Send the Result and Error fields of StopCCN and CDN messages in network byte order. Signed-off-by: Guillaume Nault --- accel-pppd/ctrl/l2tp/l2tp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/accel-pppd/ctrl/l2tp/l2tp.c b/accel-pppd/ctrl/l2tp/l2tp.c index 0fff3a0..1179e62 100644 --- a/accel-pppd/ctrl/l2tp/l2tp.c +++ b/accel-pppd/ctrl/l2tp/l2tp.c @@ -396,7 +396,7 @@ static int l2tp_send_StopCCN(struct l2tp_conn_t *conn, uint16_t res, uint16_t err) { struct l2tp_packet_t *pack = NULL; - struct l2tp_avp_result_code rc = {res, err}; + struct l2tp_avp_result_code rc = {htons(res), htons(err)}; pack = l2tp_packet_alloc(2, Message_Type_Stop_Ctrl_Conn_Notify, &conn->peer_addr); @@ -419,7 +419,7 @@ out_err: static int l2tp_send_CDN(struct l2tp_sess_t *sess, uint16_t res, uint16_t err) { struct l2tp_packet_t *pack = NULL; - struct l2tp_avp_result_code rc = {res, err}; + struct l2tp_avp_result_code rc = {htons(res), htons(err)}; pack = l2tp_packet_alloc(2, Message_Type_Call_Disconnect_Notify, &sess->paren_conn->peer_addr); -- cgit v1.2.3