summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenys Fedoryshchenko <denys.f@collabora.com>2026-08-09 07:07:39 +0300
committerDenys Fedoryshchenko <denys.f@collabora.com>2026-08-09 08:58:08 +0300
commitd76b2f6c6b8f2c510fae5beb24e261901a221d3c (patch)
tree0657ce0ac22957c0d2dd082d2b605d29d255f432
parenta62e3abe2aae259f90289b431e086490020d49ed (diff)
downloadaccel-ppp-d76b2f6c6b8f2c510fae5beb24e261901a221d3c.tar.gz
accel-ppp-d76b2f6c6b8f2c510fae5beb24e261901a221d3c.zip
pptp: fix byte order of peer call id in Call-Disconnect-Notify
conn->peer_call_id is assigned msg->call_id straight from the wire, so it holds a network order value, but send_pptp_call_disconnect_notify() then applies htons() to it. On little-endian hosts the field is swapped twice and a peer call id of 0x1234 is sent as 0x3412, so the peer cannot match the notify to its call. Big-endian hosts are unaffected, as both swaps are no-ops there. Store the call id in host order, which is what the htons() at the point of use expects. Nothing else reads the field.
-rw-r--r--accel-pppd/ctrl/pptp/pptp.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/accel-pppd/ctrl/pptp/pptp.c b/accel-pppd/ctrl/pptp/pptp.c
index cc4d222a..b55260ba 100644
--- a/accel-pppd/ctrl/pptp/pptp.c
+++ b/accel-pppd/ctrl/pptp/pptp.c
@@ -409,7 +409,7 @@ static int pptp_out_call_rqst(struct pptp_conn_t *conn)
}
conn->call_id = src_addr.sa_addr.pptp.call_id;
- conn->peer_call_id = msg->call_id;
+ conn->peer_call_id = ntohs(msg->call_id);
conn->ppp.fd = pptp_sock;
conn->ppp.ses.chan_name = _strdup(inet_ntoa(dst_addr.sa_addr.pptp.sin_addr));