From 1c64000431d0d7ebc33433dbda1f3e2abdc6f241 Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Wed, 18 Oct 2017 23:16:02 +0200 Subject: [PATCH] net_accept(): Inherit PPID from listening socket When we call accept() on a listening socket, we need to inherit the sctp PPID from the master socket to the new socket of the just-accepted connection. Otherwise any sent packets (such as S1AP) will be sent to PPID=0 rather than the configured PPID (e.g. 18 for S1AP). --- lib/core/src/unix/net_lib.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/core/src/unix/net_lib.c b/lib/core/src/unix/net_lib.c index 85ee901f8..cc4bc9257 100644 --- a/lib/core/src/unix/net_lib.c +++ b/lib/core/src/unix/net_lib.c @@ -638,6 +638,7 @@ int net_accept(net_sock_t **new_accept_sock, net_sock_t *net_sock, int timeout) node->sock_id = new_sock; node->proto = net_sock->proto; + node->ppid = net_sock->ppid; *new_accept_sock = node; /* Save local and remote address */