Linux Netfilter development
 help / color / mirror / Atom feed
* RFC: libnetfilter_queue: nfq_udp_get_payload_len() gives wrong answer
@ 2019-12-08  3:49 Duncan Roe
  2019-12-09 21:12 ` Pablo Neira Ayuso
  0 siblings, 1 reply; 4+ messages in thread
From: Duncan Roe @ 2019-12-08  3:49 UTC (permalink / raw)
  To: Netfilter Development

nfq_udp_get_payload() correctly returns a pointer to the first data byte in a
UDP message, e.g. to "A" in the message "ASD\n".

BUT nfq_udp_get_payload_len() returns 12 for the length of the above message,
i.e. combined lengths of payload and UDP header.

I plan to do an update of the documentation in src/extra/udp.c so I can document
this behaviour then.

OR

Should I change the behaviour of nfq_udp_get_payload_len() to what one would
expect? (e.g. return 4 in the example above)

OR

Should there be a new function, say nfq_udp_get_payload_len2(), to give the
expected answer?

AND, should the new or updated function guard against returning a -ve result?
(which, being unsigned, would become a large +ve result)

Any opinions?

Cheers ... Duncan.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-12-11 21:59 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-12-08  3:49 RFC: libnetfilter_queue: nfq_udp_get_payload_len() gives wrong answer Duncan Roe
2019-12-09 21:12 ` Pablo Neira Ayuso
2019-12-09 23:52   ` [PATCH libnetfilter_queue] src: Fix value returned by nfq_udp_get_payload_len() Duncan Roe
2019-12-11 21:59     ` Pablo Neira Ayuso

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox