Bug 241462 - netgraph/ng_tag: Variable length data can not be set for all length
Summary: netgraph/ng_tag: Variable length data can not be set for all length
Status: New
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Some People
Assignee: freebsd-net mailing list
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-10-24 11:33 UTC by lutz
Modified: 2019-10-25 05:49 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description lutz 2019-10-24 11:33:25 UTC
ng_tag does can operator on arbitary data of mbuf_tags.
This only works for any data sets.

+ mkpeer . tag t t
+ msg t sethookin { thisHook="t" tag_len=4 tag_data=[1] }

works. But the following does not:

+ msg t sethookin { thisHook="t" tag_len=1 tag_data=[1] }
ngctl: send msg: Invalid argument

Especially in the case of checking for mbuf_tag values, the length
of checked data is important.

The reason behind this behavior is, that the record size
is padded to the next multiple of the alignment. Therefore
it's sufficient to check for large enough data received.

Patch is in review D22140