diff options
author | Vladislav Grishenko <themiron@mail.ru> | 2017-01-28 03:02:22 +0500 |
---|---|---|
committer | Vladislav Grishenko <themiron@mail.ru> | 2017-12-05 17:03:40 +0500 |
commit | faf5bf8a0f40119273b94d8c80bafaaabb3d185e (patch) | |
tree | 0ad46f486196916b6c2cad5db7578c14846c938a /accel-pppd/ctrl/l2tp | |
parent | 9ed37b916509d02e2296e39f5210d1d8f4999e95 (diff) | |
download | accel-ppp-faf5bf8a0f40119273b94d8c80bafaaabb3d185e.tar.gz accel-ppp-faf5bf8a0f40119273b94d8c80bafaaabb3d185e.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.
Diffstat (limited to 'accel-pppd/ctrl/l2tp')
-rw-r--r-- | accel-pppd/ctrl/l2tp/packet.c | 8 |
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) |