File tree Expand file tree Collapse file tree 1 file changed +15
-11
lines changed Expand file tree Collapse file tree 1 file changed +15
-11
lines changed Original file line number Diff line number Diff line change @@ -1957,18 +1957,22 @@ PHP_FUNCTION(socket_set_option)
1957
1957
case SO_ATTACH_REUSEPORT_CBPF : {
1958
1958
convert_to_long (arg4 );
1959
1959
if (!Z_LVAL_P (arg4 )) {
1960
- RETURN_FALSE ;
1960
+ ov = 1 ;
1961
+ optlen = sizeof (ov );
1962
+ opt_ptr = & ov ;
1963
+ optname = SO_DETACH_BPF ;
1964
+ } else {
1965
+ static struct sock_filter cbpf [] = {
1966
+ BPF_STMT ((BPF_LD |BPF_W |BPF_ABS ), (uint32_t )(SKF_AD_OFF + SKF_AD_CPU )),
1967
+ BPF_STMT ((BPF_RET |BPF_A ), 0 ),
1968
+ };
1969
+ static struct sock_fprog bpfprog = {
1970
+ .len = (sizeof (cbpf ) / sizeof (cbpf [0 ])),
1971
+ .filter = cbpf ,
1972
+ };
1973
+ optlen = sizeof (bpfprog );
1974
+ opt_ptr = & bpfprog ;
1961
1975
}
1962
- static struct sock_filter cbpf [] = {
1963
- BPF_STMT ((BPF_LD |BPF_W |BPF_ABS ), (uint32_t )(SKF_AD_OFF + SKF_AD_CPU )),
1964
- BPF_STMT ((BPF_RET |BPF_A ), 0 ),
1965
- };
1966
- static struct sock_fprog bpfprog = {
1967
- .len = (sizeof (cbpf ) / sizeof (cbpf [0 ])),
1968
- .filter = cbpf ,
1969
- };
1970
- optlen = sizeof (bpfprog );
1971
- opt_ptr = & bpfprog ;
1972
1976
break ;
1973
1977
}
1974
1978
#endif
You can’t perform that action at this time.
0 commit comments