Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bpf: nat: tolerate unhandled protocol types in revSNAT path #25740

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions bpf/lib/nat.h
Original file line number Diff line number Diff line change
Expand Up @@ -1152,7 +1152,7 @@ snat_v4_rev_nat_handle_icmp_frag_needed(struct __ctx_buff *ctx, __u64 off)
tuple.dport = identifier;
break;
default:
return DROP_UNKNOWN_L4;
return NAT_PUNT_TO_STACK;
}
state = snat_v4_lookup(&tuple);
if (!state)
Expand Down Expand Up @@ -1225,7 +1225,7 @@ snat_v4_rev_nat(struct __ctx_buff *ctx, const struct ipv4_nat_target *target, __
break;
case ICMP_DEST_UNREACH:
if (icmphdr.code != ICMP_FRAG_NEEDED)
return DROP_UNKNOWN_ICMP_CODE;
return NAT_PUNT_TO_STACK;
return snat_v4_rev_nat_handle_icmp_frag_needed(ctx, off);
default:
return NAT_PUNT_TO_STACK;
Expand Down Expand Up @@ -1951,7 +1951,7 @@ snat_v6_rev_nat_handle_icmp_pkt_toobig(struct __ctx_buff *ctx, __u32 off)
tuple.dport = identifier;
break;
default:
return DROP_UNKNOWN_L4;
return NAT_PUNT_TO_STACK;
}
state = snat_v6_lookup(&tuple);
if (!state)
Expand Down