- LOG(4, s, t, "Sending LCP ConfigReq for PAP\n");
- *q = ConfigReq;
- *(uint8_t *)(q + 1) = (time_now % 255) + 1; // ID
- *(uint16_t *)(q + 2) = htons(14); // Length
- *(uint8_t *)(q + 4) = 5;
- *(uint8_t *)(q + 5) = 6;
- *(uint32_t *)(q + 6) = htonl(session[s].magic);
- *(uint8_t *)(q + 10) = 3;
+ LOG(4, s, t, "Sending LCP ConfigReq for %s\n",
+ config->radius_authprefer == AUTHCHAP ? "CHAP" : "PAP");
+
+ if (!session[s].mru)
+ session[s].mru = DEFAULT_MRU;
+
+ l = q;
+ *l++ = ConfigReq;
+ *l++ = (time_now % 255) + 1; // ID
+
+ *l++ = 1; *l++ = 4; // Maximum-Receive-Unit (length 4)
+ *(uint16_t *) l = htons(session[s].mru); l += 2;
+
+ *l++ = 3; // Authentication-Protocol