From 4a12ea24f72c833e0294511d2a4a29788b119953 Mon Sep 17 00:00:00 2001 From: Guillaume Nault Date: Mon, 11 Feb 2013 21:01:51 +0100 Subject: l2tp: Display SCCRQ packets in l2tp_recv_SCCRQ() The "recv " message printing should logically belong to the SCCRQ message reception function. This patch moves this message from l2tp_tunnel_alloc() to l2tp_recv_SCCRQ() in order to make l2tp_tunnel_alloc() usable in situations different than SCCRQ message handling. Signed-off-by: Guillaume Nault --- accel-pppd/ctrl/l2tp/l2tp.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'accel-pppd') diff --git a/accel-pppd/ctrl/l2tp/l2tp.c b/accel-pppd/ctrl/l2tp/l2tp.c index 3722915..bdfd9ff 100644 --- a/accel-pppd/ctrl/l2tp/l2tp.c +++ b/accel-pppd/ctrl/l2tp/l2tp.c @@ -705,12 +705,6 @@ static struct l2tp_conn_t *l2tp_tunnel_alloc(struct l2tp_serv_t *serv, conn->tunnel_fd = -1; - if (conf_verbose) { - log_switch(&conn->ctx, NULL); - log_ppp_info2("recv "); - l2tp_packet_print(pack, log_ppp_info2); - } - conn->sessions = NULL; conn->sess_count = 0; @@ -1142,6 +1136,12 @@ static int l2tp_recv_SCCRQ(struct l2tp_serv_t *serv, struct l2tp_packet_t *pack, if (conn == NULL) return -1; + if (conf_verbose) { + log_switch(&conn->ctx, NULL); + log_ppp_info2("recv "); + l2tp_packet_print(pack, log_ppp_info2); + } + conn->peer_tid = assigned_tid->val.uint16; if (l2tp_tunnel_start(conn, (triton_event_func)l2tp_send_SCCRP, conn) < 0) { -- cgit v1.2.3