On Dec 29, 11:56pm, al...@yandex.ru (Alexander Nasonov) wrote: -- Subject: Re: CVS commit: src/sys/net
| Christos Zoulas wrote: | > On Dec 29, 10:09pm, al...@yandex.ru (Alexander Nasonov) wrote: | > | Not sure FreeBSD got BPF_IND case right. They basically disabled using | > | big positive values of pc->k for small negative values. They could just | > | copy code from BPF_ABS case: | > | | > | > + if (k > buflen || sizeof(int16_t) > buflen - k) { | > | | > | but they didn't. Can we assume that loads with negative offsets relative | > | to X (e.g. P[X-1:4]) are not allowed by bpf? | > | > I suppose by turning k unsigned, they really want to disable negative offsets. | > We could allow them if needed, but at that point it is better to make k signed. | | I wish they stated it explicitly in bpf(4). Can I document it in our | bpf(4)? Sure, please do. christos