diff options
| author | Denys Fedoryshchenko <denys.f@collabora.com> | 2026-06-23 18:58:26 +0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-06-23 18:58:26 +0300 |
| commit | 5787a45a952c021f697b31abe0063013912d7c8b (patch) | |
| tree | 23cea64bc4a44de5a6029e1425df79e92c8d9b8d /accel-pppd/ctrl | |
| parent | 61699f574e2b1dda858bf39b7426c844e14de2c7 (diff) | |
| parent | af89a0a59765abb4a74b680aa7fe8c1b75488221 (diff) | |
| download | accel-ppp-5787a45a952c021f697b31abe0063013912d7c8b.tar.gz accel-ppp-5787a45a952c021f697b31abe0063013912d7c8b.zip | |
Merge pull request #323 from nuclearcat/stability-fixes
Stability fixes
Diffstat (limited to 'accel-pppd/ctrl')
| -rw-r--r-- | accel-pppd/ctrl/pppoe/pppoe.c | 6 | ||||
| -rw-r--r-- | accel-pppd/ctrl/sstp/sstp.c | 7 |
2 files changed, 8 insertions, 5 deletions
diff --git a/accel-pppd/ctrl/pppoe/pppoe.c b/accel-pppd/ctrl/pppoe/pppoe.c index d543a129..0cc23180 100644 --- a/accel-pppd/ctrl/pppoe/pppoe.c +++ b/accel-pppd/ctrl/pppoe/pppoe.c @@ -298,9 +298,15 @@ static void pppoe_conn_ctx_switch(struct triton_context_t *ctx, void *arg) static struct pppoe_conn_t *allocate_channel(struct pppoe_serv_t *serv, const uint8_t *addr, const struct pppoe_tag *host_uniq, const struct pppoe_tag *relay_sid, const struct pppoe_tag *service_name, const struct pppoe_tag *tr101, const uint8_t *cookie, uint16_t ppp_max_payload) { + struct pppoe_tag empty_service_name = { + .tag_type = htons(TAG_SERVICE_NAME), + }; struct pppoe_conn_t *conn; unsigned long *old_sid_ptr; + if (!service_name) + service_name = &empty_service_name; + conn = mempool_alloc(conn_pool); if (!conn) { log_error("pppoe: out of memory\n"); diff --git a/accel-pppd/ctrl/sstp/sstp.c b/accel-pppd/ctrl/sstp/sstp.c index 21c519fa..6c2b9ca9 100644 --- a/accel-pppd/ctrl/sstp/sstp.c +++ b/accel-pppd/ctrl/sstp/sstp.c @@ -1240,7 +1240,7 @@ static int ppp_write(struct triton_md_handler_t *h) ssize_t n; int i; - if (!list_empty(&conn->ppp_queue)) { + while (!list_empty(&conn->ppp_queue)) { i = n = 0; list_for_each_entry(buf, &conn->ppp_queue, entry) { if (i < PPP_BUF_IOVEC && n < PPP_BUF_SIZE) { @@ -1272,9 +1272,6 @@ static int ppp_write(struct triton_md_handler_t *h) list_del(&buf->entry); free_buf(buf); } while (n > 0); - - if (!list_empty(&conn->ppp_queue)) - goto defer; } triton_md_disable_handler(h, MD_MODE_WRITE); return 0; @@ -1849,7 +1846,7 @@ static int sstp_recv_data_packet(struct sstp_conn_t *conn, struct sstp_hdr *hdr) buf_put_data(buf, hdr->data, size); #else - buf = alloc_buf(size*2 + 2 + PPP_FCSLEN); + buf = alloc_buf(size*2 + 2 + PPP_FCSLEN*2); if (!buf) { log_error("sstp: no memory\n"); return -1; |
