netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: David Miller <davem@davemloft.net>
Cc: netdev@vger.kernel.org
Subject: Re: [PATCH 03/16] ipv4: Pull redirect instantiation out into a helper function.
Date: Thu, 12 Jul 2012 01:59:33 -0700	[thread overview]
Message-ID: <1342083573.7969.3.camel@joe2Laptop> (raw)
In-Reply-To: <20120712.011056.1351038732588424856.davem@davemloft.net>

On Thu, 2012-07-12 at 01:10 -0700, David Miller wrote:
[]
> diff --git a/net/ipv4/route.c b/net/ipv4/route.c

just a trivial style note:

> @@ -1271,6 +1271,26 @@ static void rt_del(unsigned int hash, struct rtable *rt)
>  	spin_unlock_bh(rt_hash_lock_addr(hash));
>  }
>  
> +static void ip_do_redirect(struct rtable *rt, __be32 old_gw, __be32 new_gw)
> +{
> +	struct neighbour *n;
> +
> +	if (rt->rt_gateway != old_gw)
> +		return;
> +
> +	n = ipv4_neigh_lookup(&rt->dst, NULL, &new_gw);
> +	if (n) {

Might as well use
	if (!n)
		return;
and save an indent level.

> +		if (!(n->nud_state & NUD_VALID)) {
> +			neigh_event_send(n, NULL);
> +		} else {
> +			rt->rt_gateway = new_gw;
> +			rt->rt_flags |= RTCF_REDIRECTED;
> +			call_netevent_notifiers(NETEVENT_NEIGH_UPDATE, n);
> +		}
> +		neigh_release(n);
> +	}
> +}
> +

      reply	other threads:[~2012-07-12  8:59 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-12  8:10 [PATCH 03/16] ipv4: Pull redirect instantiation out into a helper function David Miller
2012-07-12  8:59 ` Joe Perches [this message]

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=1342083573.7969.3.camel@joe2Laptop \
    --to=joe@perches.com \
    --cc=davem@davemloft.net \
    --cc=netdev@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).