Re: [BUG] One-liner array initialization with two pointers in BPF results in NULLs

2021-03-10 Thread Florent Revest
On Wed, Mar 10, 2021 at 10:51 PM Andrii Nakryiko wrote: > On Wed, Mar 10, 2021 at 12:12 PM Andrii Nakryiko > wrote: > > On Wed, Mar 10, 2021 at 8:59 AM Yonghong Song wrote: > > > On 3/10/21 3:48 AM, Florent Revest wrote: > > > > On Wed, Mar 10, 2021 at 6:16 AM Yonghong Song wrote: > > > >> On 3

Re: [BUG] One-liner array initialization with two pointers in BPF results in NULLs

2021-03-10 Thread Andrii Nakryiko
On Wed, Mar 10, 2021 at 12:12 PM Andrii Nakryiko wrote: > > On Wed, Mar 10, 2021 at 8:59 AM Yonghong Song wrote: > > > > > > > > On 3/10/21 3:48 AM, Florent Revest wrote: > > > On Wed, Mar 10, 2021 at 6:16 AM Yonghong Song wrote: > > >> On 3/9/21 7:43 PM, Yonghong Song wrote: > > >>> On 3/9/21 5

Re: [BUG] One-liner array initialization with two pointers in BPF results in NULLs

2021-03-10 Thread Andrii Nakryiko
On Wed, Mar 10, 2021 at 8:59 AM Yonghong Song wrote: > > > > On 3/10/21 3:48 AM, Florent Revest wrote: > > On Wed, Mar 10, 2021 at 6:16 AM Yonghong Song wrote: > >> On 3/9/21 7:43 PM, Yonghong Song wrote: > >>> On 3/9/21 5:54 PM, Florent Revest wrote: > I noticed that initializing an array o

Re: [BUG] One-liner array initialization with two pointers in BPF results in NULLs

2021-03-10 Thread Yonghong Song
On 3/10/21 3:48 AM, Florent Revest wrote: On Wed, Mar 10, 2021 at 6:16 AM Yonghong Song wrote: On 3/9/21 7:43 PM, Yonghong Song wrote: On 3/9/21 5:54 PM, Florent Revest wrote: I noticed that initializing an array of pointers using this syntax: __u64 array[] = { (__u64)&var1, (__u64)&var2 }

Re: [BUG] One-liner array initialization with two pointers in BPF results in NULLs

2021-03-10 Thread Florent Revest
On Wed, Mar 10, 2021 at 6:16 AM Yonghong Song wrote: > On 3/9/21 7:43 PM, Yonghong Song wrote: > > On 3/9/21 5:54 PM, Florent Revest wrote: > >> I noticed that initializing an array of pointers using this syntax: > >> __u64 array[] = { (__u64)&var1, (__u64)&var2 }; > >> (which is a fairly common o

Re: [BUG] One-liner array initialization with two pointers in BPF results in NULLs

2021-03-09 Thread Yonghong Song
On 3/9/21 7:43 PM, Yonghong Song wrote: On 3/9/21 5:54 PM, Florent Revest wrote: I noticed that initializing an array of pointers using this syntax: __u64 array[] = { (__u64)&var1, (__u64)&var2 }; (which is a fairly common operation with macros such as BPF_SEQ_PRINTF) always results in arra

Re: [BUG] One-liner array initialization with two pointers in BPF results in NULLs

2021-03-09 Thread Yonghong Song
On 3/9/21 5:54 PM, Florent Revest wrote: I noticed that initializing an array of pointers using this syntax: __u64 array[] = { (__u64)&var1, (__u64)&var2 }; (which is a fairly common operation with macros such as BPF_SEQ_PRINTF) always results in array[0] and array[1] being NULL. Interestingl

[BUG] One-liner array initialization with two pointers in BPF results in NULLs

2021-03-09 Thread Florent Revest
I noticed that initializing an array of pointers using this syntax: __u64 array[] = { (__u64)&var1, (__u64)&var2 }; (which is a fairly common operation with macros such as BPF_SEQ_PRINTF) always results in array[0] and array[1] being NULL. Interestingly, if the array is only initialized with one p