Skip to content

Commit 0748eff

Browse files
committed
revert(stack-select): drop ff_host_socket bypass that abandoned F-Stack
ff_socket(SOCK_KERNEL) wrongly routed to a raw host socket, bypassing the F-Stack user-space stack entirely. Revert ff_host_socket and the ff_socket bypass branch to restore the clean F-Stack path; coexistence will be redone (hook FF_KERNEL_EVENT baseline + native unified-event) per the reworked spec.
1 parent efcfce2 commit 0748eff

3 files changed

Lines changed: 0 additions & 32 deletions

File tree

lib/ff_host_interface.c

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@
3535
#include <stdlib.h>
3636
#include <sys/mman.h>
3737
#include <sys/stat.h>
38-
#include <sys/socket.h>
3938
#include <pthread.h>
4039
#include <sched.h>
4140
#include <time.h>
@@ -236,12 +235,6 @@ char *ff_getenv(const char *name)
236235
return getenv(name);
237236
}
238237

239-
int
240-
ff_host_socket(int domain, int type, int protocol)
241-
{
242-
return socket(domain, type, protocol);
243-
}
244-
245238
void ff_os_errno(int error)
246239
{
247240
switch (error) {

lib/ff_host_interface.h

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -91,14 +91,5 @@ int ff_rss_tbl_get_portrange(uint32_t saddr, uint32_t daddr, uint16_t sport,
9191

9292
void ff_swi_net_excute(void);
9393

94-
/*
95-
* Host kernel-stack helpers for connection-level stack selection.
96-
* ff_host_socket(): create a socket on the host Linux kernel stack.
97-
* ff_default_stack_is_kernel(): returns non-zero when config.ini
98-
* [stack] default_stack == kernel for this process.
99-
*/
100-
int ff_host_socket(int domain, int type, int protocol);
101-
int ff_default_stack_is_kernel(void);
102-
10394
#endif
10495

lib/ff_syscall_wrapper.c

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -914,22 +914,6 @@ ff_socket(int domain, int type, int protocol)
914914
{
915915
int rc;
916916
struct socket_args sa;
917-
918-
/*
919-
* Stack selection (M3/M4): route this socket to the host Linux kernel
920-
* stack when it carries an explicit SOCK_KERNEL marker (without
921-
* SOCK_FSTACK), or when no marker is set and the process default stack is
922-
* "kernel" (config.ini [stack] default_stack=kernel). The returned fd is a
923-
* host kernel fd; in native ff_api mode it must be used with host syscalls
924-
* (bind/listen/connect/epoll/...), not ff_*, since native mode has no
925-
* per-fd ownership routing (see docs/kernel_event_support_spec/zh_cn).
926-
* The default / SOCK_FSTACK path below stays unchanged (no regression).
927-
*/
928-
if (!(type & SOCK_FSTACK) &&
929-
((type & SOCK_KERNEL) || ff_default_stack_is_kernel())) {
930-
return ff_host_socket(domain, type & ~SOCK_KERNEL, protocol);
931-
}
932-
933917
sa.domain = domain == LINUX_AF_INET6 ? AF_INET6 : domain;
934918
sa.type = linux2freebsd_socket_flags(type);
935919
sa.protocol = protocol;

0 commit comments

Comments
 (0)