Skip to content

Commit 1af271c

Browse files
Update bpf-prog/block-iptables/bpf/src/block_iptables.bpf.c
Co-authored-by: Copilot <[email protected]> Signed-off-by: Santhosh Prabhu <[email protected]>
1 parent 9ac5fa6 commit 1af271c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

bpf-prog/block-iptables/bpf/src/block_iptables.bpf.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ int BPF_PROG(iptables_legacy_block, struct socket *sock, int level, int optname)
8080

8181
// bpf_printk("setsockopt called %d %d\n", level, optname);
8282
if (level == 0 /*IPPROTO_IP*/ || level == 41 /*IPPROTO_IP6*/) {
83-
if (optname == 64) { // 64 represents IPT_SO_SET_REPLACE or IP6T_SO_SET_REPLACE, depending on the level
83+
if (optname == IPT_SO_SET_REPLACE) { // IPT_SO_SET_REPLACE represents IPT_SO_SET_REPLACE or IP6T_SO_SET_REPLACE, depending on the level
8484
if (is_host_ns() && !is_allowed_parent()) {
8585
return -EPERM;
8686
}

0 commit comments

Comments
 (0)