> On Aug 22, 2018, at 12:13 PM, Toke Høiland-Jørgensen <t...@toke.dk> wrote: > > Jonathan Morton <chromati...@gmail.com> writes: > >>> On 22 Aug, 2018, at 12:51 pm, Pete Heist <p...@heistp.net> wrote: >>> >>> "math between pkt pointer and 4294901760 is not allowed" >> >> As a possible clue here, 4294901760 == (2^32) - (2^16). >> >> I suspect both errors are being caused by the call to memcpy(). This >> potentially inlines a substantial amount of code which may not be >> eBPF-clean. > > Yeah, I think this is a good guess. You could try using > __builtin_memcpy() instead; that may do fewer pointer shenanigans than > the function-header-defined one...
Thanks for those ideas. It sounded good to me too, but __builtin_memcpy does the same, as does replacing memcpy with a manually unrolled loop (committed as IPV6_SUPPORT_V3). Backing up, I’m not even sure why I have to put the IPv6 address on the stack. For IPv4, I just have a pointer to a “struct iphdr” set at an offset from head, not on the stack at all, and it works fine to reference &ip4->daddr directly. For IPv6 (IPV6_SUPPORT_V1), it doesn’t. I have to look at that (2^32) - (2^16) value, seems key, and I might find some clues in the example Dave sent. Or understand the bytecode… :) _______________________________________________ Cake mailing list Cake@lists.bufferbloat.net https://lists.bufferbloat.net/listinfo/cake