summaryrefslogtreecommitdiff
path: root/accel-pppd
diff options
context:
space:
mode:
authorGuillaume Nault <g.nault@alphalink.fr>2014-04-08 22:54:50 +0200
committerDmitry Kozlov <xeb@mail.ru>2014-04-11 06:47:27 +0400
commit9bcd65d1f4b4bfaa973fc4b58208cd0d36028e71 (patch)
tree78bf784030d03251242ae71547413329a98bf5d1 /accel-pppd
parentf0f5c28e7a929285148e1cfc3788f1f1dbdc09d5 (diff)
downloadaccel-ppp-9bcd65d1f4b4bfaa973fc4b58208cd0d36028e71.tar.gz
accel-ppp-9bcd65d1f4b4bfaa973fc4b58208cd0d36028e71.zip
l2tp: ignore l2tp_{tunnel, session}_send() return values
Stop checking for l2tp_{tunnel,session}_send() return values. These functions now always succeed, unless the session or tunnel is closing (in which case packet is automatically dropped and caller doesn't need to take any special action). Signed-off-by: Guillaume Nault <g.nault@alphalink.fr>
Diffstat (limited to 'accel-pppd')
-rw-r--r--accel-pppd/ctrl/l2tp/l2tp.c60
1 files changed, 10 insertions, 50 deletions
diff --git a/accel-pppd/ctrl/l2tp/l2tp.c b/accel-pppd/ctrl/l2tp/l2tp.c
index bede32d..125e818 100644
--- a/accel-pppd/ctrl/l2tp/l2tp.c
+++ b/accel-pppd/ctrl/l2tp/l2tp.c
@@ -630,11 +630,7 @@ static int l2tp_send_StopCCN(struct l2tp_conn_t *conn,
goto out_err;
}
- if (l2tp_tunnel_send(conn, pack) < 0) {
- log_tunnel(log_error, conn, "impossible to send StopCCN:"
- " sending packet failed\n");
- return -1;
- }
+ l2tp_tunnel_send(conn, pack);
return 0;
@@ -674,11 +670,7 @@ static int l2tp_send_CDN(struct l2tp_sess_t *sess, uint16_t res, uint16_t err)
goto out_err;
}
- if (l2tp_session_send(sess, pack) < 0) {
- log_session(log_error, sess, "impossible to send CDN:"
- " sending packet failed\n");
- return -1;
- }
+ l2tp_session_send(sess, pack);
return 0;
@@ -720,11 +712,7 @@ static int l2tp_tunnel_send_CDN(uint16_t sid, uint16_t peer_sid,
pack->hdr.sid = htons(peer_sid);
- if (l2tp_tunnel_send(conn, pack) < 0) {
- log_tunnel(log_error, conn, "impossible to send CDN:"
- " sending packet failed\n");
- return -1;
- }
+ l2tp_tunnel_send(conn, pack);
return 0;
@@ -2191,11 +2179,7 @@ static int l2tp_send_SCCCN(struct l2tp_conn_t *conn)
}
l2tp_tunnel_storechall(conn, NULL);
- if (l2tp_tunnel_send(conn, pack) < 0) {
- log_tunnel(log_error, conn, "impossible to send SCCCN:"
- " sending packet failed\n");
- goto err;
- }
+ l2tp_tunnel_send(conn, pack);
return 0;
@@ -2233,11 +2217,7 @@ static int l2tp_send_ICRQ(struct l2tp_sess_t *sess)
goto out_err;
}
- if (l2tp_session_send(sess, pack) < 0) {
- log_session(log_error, sess, "impossible to send ICRQ:"
- " sending packet failed\n");
- return -1;
- }
+ l2tp_session_send(sess, pack);
return 0;
@@ -2269,11 +2249,7 @@ static int l2tp_send_ICRP(struct l2tp_sess_t *sess)
goto out_err;
}
- if (l2tp_session_send(sess, pack) < 0) {
- log_session(log_error, sess, "impossible to send ICRP:"
- " sending packet failed\n");
- return -1;
- }
+ l2tp_session_send(sess, pack);
return 0;
@@ -2315,11 +2291,7 @@ static int l2tp_send_ICCN(struct l2tp_sess_t *sess)
goto out_err;
}
- if (l2tp_session_send(sess, pack) < 0) {
- log_session(log_error, sess, "impossible to send ICCN:"
- " sending packet failed\n");
- return -1;
- }
+ l2tp_session_send(sess, pack);
return 0;
@@ -2381,11 +2353,7 @@ static int l2tp_send_OCRQ(struct l2tp_sess_t *sess)
goto out_err;
}
- if (l2tp_session_send(sess, pack) < 0) {
- log_session(log_error, sess, "impossible to send OCRQ:"
- " sending packet failed\n");
- return -1;
- }
+ l2tp_session_send(sess, pack);
return 0;
@@ -2417,11 +2385,7 @@ static int l2tp_send_OCRP(struct l2tp_sess_t *sess)
goto out_err;
}
- if (l2tp_session_send(sess, pack) < 0) {
- log_session(log_error, sess, "impossible to send OCRP:"
- " sending packet failed\n");
- return -1;
- }
+ l2tp_session_send(sess, pack);
return 0;
@@ -2463,11 +2427,7 @@ static int l2tp_send_OCCN(struct l2tp_sess_t *sess)
goto out_err;
}
- if (l2tp_session_send(sess, pack) < 0) {
- log_session(log_error, sess, "impossible to send OCCN:"
- " sending packet failed\n");
- return -1;
- }
+ l2tp_session_send(sess, pack);
return 0;