summaryrefslogtreecommitdiff
path: root/accel-pppd/ctrl/pppoe/tr101.c
diff options
context:
space:
mode:
authorGuillaume Nault <g.nault@alphalink.fr>2014-01-17 22:01:35 +0100
committerDmitry Kozlov <xeb@mail.ru>2014-01-19 14:22:18 +0400
commitbf4aad6aeb3e2f150b642f29881b8de691038ac2 (patch)
tree6350f27adf4687e55a7349b2531764f8c0cdc922 /accel-pppd/ctrl/pppoe/tr101.c
parent4491f463cbec7206ef29b6a34cc38eebc97464e2 (diff)
downloadaccel-ppp-bf4aad6aeb3e2f150b642f29881b8de691038ac2.tar.gz
accel-ppp-bf4aad6aeb3e2f150b642f29881b8de691038ac2.zip
pppoe: handle TR-101 vs. RFC 4679 incompatibilities
There are a few inconsistencies between TR-101 and RFC 4679. Since RFC 4679 is only informational, prefer TR-101 in case of incompatibilities and explicitely document this choice. Signed-off-by: Guillaume Nault <g.nault@alphalink.fr>
Diffstat (limited to 'accel-pppd/ctrl/pppoe/tr101.c')
-rw-r--r--accel-pppd/ctrl/pppoe/tr101.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/accel-pppd/ctrl/pppoe/tr101.c b/accel-pppd/ctrl/pppoe/tr101.c
index 6fe29a8a..e91b9cfc 100644
--- a/accel-pppd/ctrl/pppoe/tr101.c
+++ b/accel-pppd/ctrl/pppoe/tr101.c
@@ -47,8 +47,11 @@ static int tr101_send_request(struct pppoe_tag *tr101, struct rad_packet_t *pack
/* Section 4 of RFC 4679 states that attributes 0x83 to 0x8E
* mustn't be included in RADIUS access requests.
+ * This is in contradiction with the TR-101 specification
+ * which excludes attributes 0x85 to 0x90.
+ * Here, we follow the TR-101 guidelines.
*/
- if (type && id > 0x82 && id < 0x90) {
+ if (type && id >= 0x85 && id =< 0x90) {
ptr += len;
continue;
}
@@ -156,6 +159,19 @@ static int tr101_send_request(struct pppoe_tag *tr101, struct rad_packet_t *pack
case ACCESS_LOOP_ENCAP:
if (len != 3)
goto inval;
+ /* Each byte in this tag represents an
+ * independent field: Data Link, Encaps 1
+ * and Encaps 2.
+ * TR-101 and RFC 4679 aggree on the meaning
+ * of the Encaps 1 and Encaps 2 fields. For
+ * Data Link, TR-101 states that 0 means AAL5
+ * and 1 means Ethernet, while RFC 4679 says
+ * AAL5 is 1 and Ethernet is 2.
+ *
+ * Currently, we build the RADIUS request using
+ * the tag received from PPPoE (TR-101 format).
+ * RFC 4679 format would require conversion.
+ */
memcpy(str, ptr, 3);
if (rad_packet_add_octets(pack, "ADSL-Forum", "Access-Loop-Encapsulation", (uint8_t *)str, 3))
return -1;