In r309408 (FreeBSD 11-CURRENT) julian added code in /usr/src/sys/netgraph/ng_patch.c to use a 'relative offset': "Changes to allow the patching of packets with an offset (and other changes.. see man page) ". It is mentioned in the struct in the man page, but there is no explanation of what the relative offset flag does and how it can be set. - from PR #206185: "Add setdlt for relative offset (support DLT_EN10MB and DLT_RAW)" - changes offset to a relative offset as it pulls up / de-encapsulates ether payloads? - relative offset seems to be a boolean (unlike offset for the command which is a byte count). It would be nice to have this documented. (julian as well as dmitry (from the PR) have been contacted but no reply)
Created attachment 228344 [details] ng_patch(4) patch Relative offset is used in two ways: - Enable/disable relative offset feature in ng_patch - When enabled, recalculate location of field based on operation offset, plus the length of data-link specific headers.