The link payload is an absolute offset from the start of the packet,
meaning that it should include any variable link prefix as well.
However, currently if somebody asks for the payload but not the link
header, the latter is not computed and is skipped. This adds a
dependency between the two, so that we always calculate the full value.
{
struct slist *s;
+ /* There is an implicit dependency between the link
+ * payload and link header since the payload computation
+ * includes the variable part of the header. Therefore,
+ * if nobody else has allocated a register for the link
+ * header and we need it, do it now. */
+ if (off_linkpl.reg != -1 && off_linkhdr.is_variable &&
+ off_linkhdr.reg == -1)
+ off_linkhdr.reg = alloc_reg();
+
/*
* For link-layer types that have a variable-length header
* preceding the link-layer header, generate code to load