summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenys Fedoryshchenko <denys.f@collabora.com>2026-09-01 08:44:10 +0300
committerDenys Fedoryshchenko <denys.f@collabora.com>2026-09-01 08:53:54 +0300
commitd70fc819a4f7f0b54b374bfdae062e3c7d2d3cc6 (patch)
treed7f8fe55bc64e0f7b846e517a89ccb21584928b2
parent028b942d2daa57b56efd61cb5cb348017fad6f05 (diff)
downloadaccel-ppp-d70fc819a4f7f0b54b374bfdae062e3c7d2d3cc6.tar.gz
accel-ppp-d70fc819a4f7f0b54b374bfdae062e3c7d2d3cc6.zip
ppp: cover alignment-safe MPPE prefer setup
Serialize the MPPE option through an aligned temporary and exercise mppe=prefer in the existing unauthenticated PPPoE session test.
-rw-r--r--accel-pppd/ppp/ccp_mppe.c3
-rw-r--r--tests/accel-pppd/pppoe/test_pppoe_session_wo_auth.py3
2 files changed, 5 insertions, 1 deletions
diff --git a/accel-pppd/ppp/ccp_mppe.c b/accel-pppd/ppp/ccp_mppe.c
index cb41c0da..c2ffd9a0 100644
--- a/accel-pppd/ppp/ccp_mppe.c
+++ b/accel-pppd/ppp/ccp_mppe.c
@@ -102,11 +102,12 @@ static int setup_mppe_key(int fd, int transmit, uint8_t *key)
{
struct ppp_option_data data;
uint8_t buf[6 + 16];
+ uint32_t bits = htonl(MPPE_S | MPPE_H);
memset(buf, 0, sizeof(buf));
buf[0] = CI_MPPE;
buf[1] = 6;
- *(uint32_t*)(buf + 2) = htonl(MPPE_S | MPPE_H);
+ memcpy(buf + 2, &bits, sizeof(bits));
if (key)
memcpy(buf + 6, key, 16);
diff --git a/tests/accel-pppd/pppoe/test_pppoe_session_wo_auth.py b/tests/accel-pppd/pppoe/test_pppoe_session_wo_auth.py
index 960b7c94..b4cccc81 100644
--- a/tests/accel-pppd/pppoe/test_pppoe_session_wo_auth.py
+++ b/tests/accel-pppd/pppoe/test_pppoe_session_wo_auth.py
@@ -26,6 +26,9 @@ def accel_pppd_config(veth_pair_netns):
[auth]
any-login=1
+ [ppp]
+ mppe=prefer
+
[ip-pool]
gw-ip-address=192.0.2.1
192.0.2.2-255