diff options
author | Guillaume Nault <g.nault@alphalink.fr> | 2013-02-11 21:01:23 +0100 |
---|---|---|
committer | Kozlov Dmitry <xeb@mail.ru> | 2013-02-12 00:12:47 +0400 |
commit | 3482afc1d308588ba0a1d152d9a8d7750911ecbf (patch) | |
tree | 50a077a23ca3e73aecc93d39574e510a77e8a191 /accel-pppd/ctrl | |
parent | b454e2fb411b2de072b68b6678876f84554bcabe (diff) | |
download | accel-ppp-3482afc1d308588ba0a1d152d9a8d7750911ecbf.tar.gz accel-ppp-3482afc1d308588ba0a1d152d9a8d7750911ecbf.zip |
l2tp: No peer-tid assignment in tunnel allocation
Peer TID assignment is specific to SCCRQ message processing. When
creating a tunnel in different conditions (e.g. upon user request),
the peer TID will be unknown.
This patch moves peer TID assignment from l2tp_tunnel_alloc() to
l2tp_recv_SCCRQ().
Signed-off-by: Guillaume Nault <g.nault@alphalink.fr>
Diffstat (limited to 'accel-pppd/ctrl')
-rw-r--r-- | accel-pppd/ctrl/l2tp/l2tp.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/accel-pppd/ctrl/l2tp/l2tp.c b/accel-pppd/ctrl/l2tp/l2tp.c index ffa5131f..731cacac 100644 --- a/accel-pppd/ctrl/l2tp/l2tp.c +++ b/accel-pppd/ctrl/l2tp/l2tp.c @@ -590,7 +590,6 @@ out_err: static struct l2tp_conn_t *l2tp_tunnel_alloc(struct l2tp_serv_t *serv, struct l2tp_packet_t *pack, struct in_pktinfo *pkt_info, - struct l2tp_attr_t *assigned_tid, struct l2tp_attr_t *framing_cap, struct l2tp_attr_t *challenge) { @@ -681,7 +680,6 @@ static struct l2tp_conn_t *l2tp_tunnel_alloc(struct l2tp_serv_t *serv, memcpy(&conn->lac_addr, &pack->addr, sizeof(pack->addr)); memcpy(&conn->lns_addr, &addr, sizeof(addr)); - conn->peer_tid = assigned_tid->val.uint16; conn->framing_cap = framing_cap->val.uint32; /* If challenge set in SCCRQ, we need to calculate response for SCCRP */ @@ -1140,10 +1138,13 @@ static int l2tp_recv_SCCRQ(struct l2tp_serv_t *serv, struct l2tp_packet_t *pack, return -1; } - conn = l2tp_tunnel_alloc(serv, pack, pkt_info, assigned_tid, + conn = l2tp_tunnel_alloc(serv, pack, pkt_info, framing_cap, challenge); if (conn == NULL) return -1; + + conn->peer_tid = assigned_tid->val.uint16; + if (l2tp_tunnel_start(conn, (triton_event_func)l2tp_send_SCCRP, conn) < 0) { l2tp_tunnel_free(conn); return -1; |