summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVladislav Grishenko <themiron@mail.ru>2017-01-28 03:02:22 +0500
committerDmitry Kozlov <xeb@mail.ru>2017-12-05 16:53:18 +0300
commit8b2558d0c5f31ba8b73ac8aa971863c0c988c786 (patch)
treeabeb2f71c3654cf4d9b929566d08825e939a3b83
parent3b128243480646fd2ec0fef90a8fc52a277f7ec2 (diff)
downloadaccel-ppp-8b2558d0c5f31ba8b73ac8aa971863c0c988c786.tar.gz
accel-ppp-8b2558d0c5f31ba8b73ac8aa971863c0c988c786.zip
l2tp: skip obsolete session data packets from logging
After session is freed on our end, kernel doesn't bother with possible incoming data packets and just passes them to userspace, in turn they are mistreated as short control packets with corresponding errors. Since there's no special data packet handling, just ignore them.
-rw-r--r--accel-pppd/ctrl/l2tp/packet.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/accel-pppd/ctrl/l2tp/packet.c b/accel-pppd/ctrl/l2tp/packet.c
index 34e4bb67..455c486e 100644
--- a/accel-pppd/ctrl/l2tp/packet.c
+++ b/accel-pppd/ctrl/l2tp/packet.c
@@ -289,21 +289,21 @@ int l2tp_recv(int fd, struct l2tp_packet_t **p, struct in_pktinfo *pkt_info,
return 0;
}
- if (n < sizeof(*hdr)) {
+ if (n < 6) {
if (conf_verbose)
log_warn("l2tp: short packet received (%i/%zu)\n", n, sizeof(*hdr));
goto out_err_hdr;
}
+ if (hdr->T == 0)
+ goto out_err_hdr;
+
if (n < ntohs(hdr->length)) {
if (conf_verbose)
log_warn("l2tp: short packet received (%i/%i)\n", n, ntohs(hdr->length));
goto out_err_hdr;
}
- if (hdr->T == 0)
- goto out_err_hdr;
-
if (hdr->ver == 2) {
if (hdr->L == 0) {
if (conf_verbose)