netdev
[Top] [All Lists]

Re: [patch] devinet: cleanup if statements

To: davem@xxxxxxxxxxxxx (David S. Miller)
Subject: Re: [patch] devinet: cleanup if statements
From: Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx>
Date: Thu, 23 Jun 2005 21:38:00 +1000
Cc: pmeda@xxxxxxxxxx, jgarzik@xxxxxxxxx, akpm@xxxxxxxx, netdev@xxxxxxxxxxx
In-reply-to: <20050621.134822.21926602.davem@davemloft.net>
Organization: Core
Sender: netdev-bounce@xxxxxxxxxxx
User-agent: tin/1.7.4-20040225 ("Benbecula") (UNIX) (Linux/2.4.27-hx-1-686-smp (i686))
David S. Miller <davem@xxxxxxxxxxxxx> wrote:
> 
> The second hunk of your patch seems to defeat the intention
> of that code.  I believe the idea is that if the label and
> the device name differ, use the label.

Actually I think Prasanna is right.  The if conditional is testing
whether ifa->ifa_label is NULL.  As ifa->ifa_label is an array and
it's not the first element in the structure, it can't possibly be
NULL.

With your interpretation above his patch is correct as well.  If
we want to use the label when it is different from the device name,
then it is equivalent to always use the label since the only time
we'd use the device name is when it's equal to the label :)

Cheers,
-- 
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <herbert@xxxxxxxxxxxxxxxxxxx>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

<Prev in Thread] Current Thread [Next in Thread>