All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jeff DeFouw <defouwj@purdue.edu>
To: linux-kernel@vger.kernel.org
Subject: [PATCH] 2.0-2.5 bug in ip_options_compile
Date: Fri, 13 Sep 2002 17:08:38 -0500	[thread overview]
Message-ID: <20020913220838.GA1579@blorp.plorb.com> (raw)

While reading about IP options, I found the IPOPT_END padding (cleaning)
in ip_options_compile (net/ipv4/ip_options.c) was not incrementing a
pointer.  There should be an optptr++ in the for end-of-block statement
to go along with the l--, otherwise it's just comparing the same byte
for each l.  Patch is against 2.4.19.  From the kernel source browser
this bug is also in 2.5.31, 2.2.21, and 2.0.39.

--- linux/net/ipv4/ip_options.c.orig	2002-09-13 15:12:24.000000000 -0500
+++ linux/net/ipv4/ip_options.c	2002-09-13 15:12:50.000000000 -0500
@@ -266,7 +266,7 @@
 	for (l = opt->optlen; l > 0; ) {
 		switch (*optptr) {
 		      case IPOPT_END:
-			for (optptr++, l--; l>0; l--) {
+			for (optptr++, l--; l>0; optptr++, l--) {
 				if (*optptr != IPOPT_END) {
 					*optptr = IPOPT_END;
 					opt->is_changed = 1;


-- 
Jeff DeFouw <defouwj@purdue.edu>

             reply	other threads:[~2002-09-13 22:03 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-09-13 22:08 Jeff DeFouw [this message]
2002-09-13 22:13 ` [PATCH] 2.0-2.5 bug in ip_options_compile David S. Miller
2002-09-13 22:50   ` David Weinehall

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=20020913220838.GA1579@blorp.plorb.com \
    --to=defouwj@purdue.edu \
    --cc=linux-kernel@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.