From: Pablo Neira Ayuso <pablo@netfilter.org>
To: lantw44@gmail.com
Cc: netfilter-devel@vger.kernel.org
Subject: Re: [PATCH 3/3] extra: fix wrong implementation in nfq_udp_get_payload_len
Date: Mon, 30 Jun 2014 12:11:08 +0200 [thread overview]
Message-ID: <20140630101108.GC5038@localhost> (raw)
In-Reply-To: <1403260021-8732-3-git-send-email-lantw44@gmail.com>
On Fri, Jun 20, 2014 at 06:27:01PM +0800, lantw44@gmail.com wrote:
> From: Ting-Wei Lan <lantw44@gmail.com>
>
> ---
> src/extra/udp.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/extra/udp.c b/src/extra/udp.c
> index 2a17a2f..64d3db4 100644
> --- a/src/extra/udp.c
> +++ b/src/extra/udp.c
> @@ -76,7 +76,7 @@ EXPORT_SYMBOL(nfq_udp_get_payload);
> */
> unsigned int nfq_udp_get_payload_len(struct udphdr *udph, struct pkt_buff *pktb)
> {
> - return pktb->tail - pktb->transport_header;
> + return pktb->tail - pktb->transport_header - sizeof(struct udphdr);
I agree that this should substract the UDP header size, but:
1) This underflows the unsigned int if the UDP header is truncated.
2) This breaks the current behaviour, but we don't have any client in
the tree for this code yet though.
Let's do it well, deprecate this interface and introduce a new one:
int nfq_udp_get_payload_length(struct udphdr *udph, struct pkt_buff *pktb)
Same thing for the tcp variant.
The deprecation can be achieved through this:
in __attribute__((deprecated) nfq_udp_get_payload_len(...)
in the header file.
Would you send me a patch for that, please?
BTW, please Signed-off-by your userspace patches too. Thanks.
next prev parent reply other threads:[~2014-06-30 10:11 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-20 10:26 [PATCH 1/3] extra: use inet_ntop instead of inet_ntoa lantw44
2014-06-20 10:27 ` [PATCH 2/3] extra: fix wrong implementation in nfq_udp_get_payload lantw44
2014-06-30 10:02 ` Pablo Neira Ayuso
2014-06-30 17:00 ` 藍挺瑋
2014-06-20 10:27 ` [PATCH 3/3] extra: fix wrong implementation in nfq_udp_get_payload_len lantw44
2014-06-30 10:11 ` Pablo Neira Ayuso [this message]
2014-06-30 9:48 ` [PATCH 1/3] extra: use inet_ntop instead of inet_ntoa Pablo Neira Ayuso
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20140630101108.GC5038@localhost \
--to=pablo@netfilter.org \
--cc=lantw44@gmail.com \
--cc=netfilter-devel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.