Skip to content

Commit c954094

Browse files
bpf: nodeport: clean up stack allocation for dsr_reply_icmp4()
With the subsequent patch I was suddenly getting a ``` error: unsupported dynamic stack allocation ``` from this code location. Simplify things a bit to help the compiler. Signed-off-by: Julian Wiedmann <jwi@isovalent.com>
1 parent 67c619c commit c954094

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

bpf/lib/nodeport.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1989,11 +1989,10 @@ static __always_inline int dsr_reply_icmp4(struct __ctx_buff *ctx,
19891989
{
19901990
#ifdef ENABLE_DSR_ICMP_ERRORS
19911991
const __s32 orig_dgram = 8, off = ETH_HLEN;
1992-
const __u32 l3_max = MAX_IPOPTLEN + sizeof(*ip4) + orig_dgram;
1992+
__u8 tmp[MAX_IPOPTLEN + sizeof(*ip4) + orig_dgram];
19931993
__s32 len_new = off + ipv4_hdrlen(ip4) + orig_dgram;
19941994
__s32 len_old = (__s32)ctx_full_len(ctx);
19951995
__u8 reason = (__u8)-code;
1996-
__u8 tmp[l3_max];
19971996
union macaddr smac, dmac;
19981997
struct icmphdr icmp __align_stack_8 = {
19991998
.type = ICMP_DEST_UNREACH,

0 commit comments

Comments
 (0)