When calculating the IP header length, we only use the variable
part of the link header to locate the IP header but we also need
to use any constant components.
Note that the constant part is not included in the total returned -
it is only used to actually locate the IP header. This is consistent
with other behavior.
* the value from the X register.
*/
s2 = new_stmt(BPF_LD|BPF_IND|BPF_B);
- s2->s.k = off_nl;
+ s2->s.k = off_linkpl.constant_part + off_nl;
sappend(s, s2);
s2 = new_stmt(BPF_ALU|BPF_AND|BPF_K);
s2->s.k = 0xf;