All of lore.kernel.org
 help / color / mirror / Atom feed
From: "David S. Miller" <davem@davemloft.net>
To: Thomas Graf <tgraf@suug.ch>
Cc: netdev@oss.sgi.com
Subject: Re: [PATCH 1/3] [RTNETLINK] Fix RTM_MAX to represent the maximum valid message type
Date: Tue, 3 May 2005 14:27:40 -0700	[thread overview]
Message-ID: <20050503142740.345925ea.davem@davemloft.net> (raw)
In-Reply-To: <20050430195058.GC577@postel.suug.ch>

On Sat, 30 Apr 2005 21:50:58 +0200
Thomas Graf <tgraf@suug.ch> wrote:

> RTM_MAX is currently set to the maximum reserverd message type plus one
> thus being the cause of two bugs for new types being assigned a) given the
> new family registers only the NEW command in its reserved block the array
> size for per family entries is calculated one entry short and b) given the
> new family registers all commands RTM_MAX would point to the first entry
> of the block following this one and the rtnetlink receive path would accept
> a message type for a nonexisting family.
> 
> This patch changes RTM_MAX to point to the maximum valid message type
> by aligning it to the start of the next block and subtracting one.
> 
> Signed-off-by: Thomas Graf <tgraf@suug.ch>

Excellent observation.  The fact that we encode the "modifies state"
in the low bits of the RTM_* numbers has always been a source of
obscure bugs and hard to track down errors.

Patch applied, thanks.

  reply	other threads:[~2005-05-03 21:27 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-04-30 19:50 [PATCH 1/3] [RTNETLINK] Fix RTM_MAX to represent the maximum valid message type Thomas Graf
2005-05-03 21:27 ` David S. Miller [this message]
2005-05-03 22:20   ` Thomas Graf
2005-05-03 22:27     ` David S. Miller
2005-05-03 23:02       ` Thomas Graf

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=20050503142740.345925ea.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=netdev@oss.sgi.com \
    --cc=tgraf@suug.ch \
    /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.