Skip to content

Commit 071e846

Browse files
committed
fix code nits
1 parent 296294f commit 071e846

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

felix/bpf-gpl/ip_v4_fragment.h

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ static CALI_BPF_INLINE bool frags4_try_assemble(struct cali_tc_ctx *ctx)
6161

6262
if (!v) {
6363
CALI_DEBUG("Missing IP fragment at offset %d", k.offset);
64-
goto out;
64+
return false;
6565
}
6666

6767
tot_len += v->len;
@@ -73,7 +73,7 @@ static CALI_BPF_INLINE bool frags4_try_assemble(struct cali_tc_ctx *ctx)
7373
k.offset += v->len;
7474
}
7575

76-
goto out;
76+
return false;
7777

7878
assemble:
7979
CALI_DEBUG("IP FRAG: Found all fragments!");
@@ -166,6 +166,10 @@ static CALI_BPF_INLINE bool frags4_handle(struct cali_tc_ctx *ctx)
166166
int r_off = skb_l4hdr_offset(ctx);
167167
bool more_frags = bpf_ntohs(ip_hdr(ctx)->frag_off) & 0x2000;
168168

169+
/* When we get a fragment, it may be large than the storage in the map.
170+
* We may need to break it into multiple fragments to be able to store
171+
* it.
172+
*/
169173
for (i = 0; i < 10; i++) {
170174
int sz = MAX_FRAG;
171175
if (r_off + sz >= ctx->skb->len) {

0 commit comments

Comments
 (0)