Skip to content

Commit a2f99af

Browse files
committed
SO_ATTACH_REUSEPORT_CBPF filter update.
SDK_AD_QUEUE support to attach to a queue.
1 parent d498908 commit a2f99af

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

ext/sockets/sockets.c

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1978,16 +1978,17 @@ PHP_FUNCTION(socket_set_option)
19781978
static struct sock_fprog bpfprog;
19791979

19801980
switch (k) {
1981-
case SKF_AD_CPU:
1982-
cbpf[0].code = (BPF_LD|BPF_W|BPF_ABS);
1983-
cbpf[0].k = (uint32_t)(SKF_AD_OFF + k);
1984-
cbpf[1].code = (BPF_RET|BPF_A);
1985-
bpfprog.len = 2;
1986-
break;
1987-
default:
1988-
php_error_docref(NULL, E_WARNING, "Unsupported CBPF filter");
1989-
RETURN_FALSE;
1990-
}
1981+
case SKF_AD_CPU:
1982+
case SKF_AD_QUEUE:
1983+
cbpf[0].code = (BPF_LD|BPF_W|BPF_ABS);
1984+
cbpf[0].k = (uint32_t)(SKF_AD_OFF + k);
1985+
cbpf[1].code = (BPF_RET|BPF_A);
1986+
bpfprog.len = 2;
1987+
break;
1988+
default:
1989+
php_error_docref(NULL, E_WARNING, "Unsupported CBPF filter");
1990+
RETURN_FALSE;
1991+
}
19911992

19921993
bpfprog.filter = cbpf;
19931994
optlen = sizeof(bpfprog);

0 commit comments

Comments
 (0)