summaryrefslogtreecommitdiff
path: root/accel-pppd/ctrl
diff options
context:
space:
mode:
authorGuillaume Nault <g.nault@alphalink.fr>2014-01-16 21:24:54 +0100
committerDmitry Kozlov <xeb@mail.ru>2014-01-17 15:35:27 +0400
commit3853053fc88c1b9a34b90174de25c5965a484e1b (patch)
treea0e3e9e9d0053bdfbd18be8ee266be2e74c0b119 /accel-pppd/ctrl
parentfe1ad9b7a0e53250c8bf2c7d238a202e81fcbc12 (diff)
downloadaccel-ppp-3853053fc88c1b9a34b90174de25c5965a484e1b.tar.gz
accel-ppp-3853053fc88c1b9a34b90174de25c5965a484e1b.zip
pppoe: fix TR-101 tag length check
The length field of PPPoE TR-101 sub-tags only takes the payload size into account (as opposed to its RADIUS counterpart that stores the full sub-tag length, including the 2 bytes long header). Signed-off-by: Guillaume Nault <g.nault@alphalink.fr>
Diffstat (limited to 'accel-pppd/ctrl')
-rw-r--r--accel-pppd/ctrl/pppoe/tr101.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/accel-pppd/ctrl/pppoe/tr101.c b/accel-pppd/ctrl/pppoe/tr101.c
index 5d1c39a..1d77f2e 100644
--- a/accel-pppd/ctrl/pppoe/tr101.c
+++ b/accel-pppd/ctrl/pppoe/tr101.c
@@ -58,25 +58,25 @@ static int tr101_send_request(struct pppoe_tag *tr101, struct rad_packet_t *pack
return -1;
break;
case OPT_ACTUAL_DATA_RATE_UP:
- if (len != 6)
+ if (len != 4)
goto inval;
if (rad_packet_add_int(pack, "ADSL-Forum", "Actual-Data-Rate-Upstream", ntohl(*(uint32_t *)ptr)))
return -1;
break;
case OPT_ACTUAL_DATA_RATE_DOWN:
- if (len != 6)
+ if (len != 4)
goto inval;
if (rad_packet_add_int(pack, "ADSL-Forum", "Actual-Data-Rate-Downstream", ntohl(*(uint32_t *)ptr)))
return -1;
break;
case OPT_MIN_DATA_RATE_UP:
- if (len != 6)
+ if (len != 4)
goto inval;
if (rad_packet_add_int(pack, "ADSL-Forum", "Minimum-Data-Rate-Upstream", ntohl(*(uint32_t *)ptr)))
return -1;
break;
case OPT_MIN_DATA_RATE_DOWN:
- if (len != 6)
+ if (len != 4)
goto inval;
if (rad_packet_add_int(pack, "ADSL-Forum", "Minimum-Data-Rate-Downstream", ntohl(*(uint32_t *)ptr)))
return -1;