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 @@ -1965,18 +1965,22 @@ PHP_FUNCTION(socket_set_option)
1965
1965
case SO_ATTACH_REUSEPORT_CBPF : {
1966
1966
convert_to_long (arg4 );
1967
1967
if (!Z_LVAL_P (arg4 )) {
1968
- RETURN_FALSE ;
1968
+ ov = 1 ;
1969
+ optlen = sizeof (ov );
1970
+ opt_ptr = & ov ;
1971
+ optname = SO_DETACH_BPF ;
1972
+ } else {
1973
+ static struct sock_filter cbpf [] = {
1974
+ BPF_STMT ((BPF_LD |BPF_W |BPF_ABS ), (uint32_t )(SKF_AD_OFF + SKF_AD_CPU )),
1975
+ BPF_STMT ((BPF_RET |BPF_A ), 0 ),
1976
+ };
1977
+ static struct sock_fprog bpfprog = {
1978
+ .len = (sizeof (cbpf ) / sizeof (cbpf [0 ])),
1979
+ .filter = cbpf ,
1980
+ };
1981
+ optlen = sizeof (bpfprog );
1982
+ opt_ptr = & bpfprog ;
1969
1983
}
1970
- static struct sock_filter cbpf [] = {
1971
- BPF_STMT ((BPF_LD |BPF_W |BPF_ABS ), (uint32_t )(SKF_AD_OFF + SKF_AD_CPU )),
1972
- BPF_STMT ((BPF_RET |BPF_A ), 0 ),
1973
- };
1974
- static struct sock_fprog bpfprog = {
1975
- .len = (sizeof (cbpf ) / sizeof (cbpf [0 ])),
1976
- .filter = cbpf ,
1977
- };
1978
- optlen = sizeof (bpfprog );
1979
- opt_ptr = & bpfprog ;
1980
1984
break ;
1981
1985
}
1982
1986
#endif
You can’t perform that action at this time.
0 commit comments