netdev
[Top] [All Lists]

Re: [patch] devinet: cleanup if statements

To: pmeda@xxxxxxxxxx
Subject: Re: [patch] devinet: cleanup if statements
From: "David S. Miller" <davem@xxxxxxxxxxxxx>
Date: Tue, 21 Jun 2005 13:48:22 -0700 (PDT)
Cc: jgarzik@xxxxxxxxx, akpm@xxxxxxxx, netdev@xxxxxxxxxxx
In-reply-to: <200506072032.NAA06207@xxxxxxxxxxxxxxxxxxxxxxxxx>
References: <200506072032.NAA06207@xxxxxxxxxxxxxxxxxxxxxxxxx>
Sender: netdev-bounce@xxxxxxxxxxx
From: pmeda@xxxxxxxxxx
Date: Tue, 7 Jun 2005 13:32:44 -0700

> Cleanup the devinet if statements.
>  - when there is no colon, interface name is same as device.
>  - ifa_label is an array, not a pointer, and so can never be null.
> 
> Signed-Off-by: Prasanna Meda <pmeda@xxxxxxxxxx>

Ok, I can see how your first change is correct.

When there is a colon, we've modified ifr.ifr_name by
patching the ':' character to be a '\0'.  This is for
the __dev_get_by_name() lookup.

After that lookup, we re-patch the ':' character back
into ifr.ifr_name.  So indeed, always using the ifr_name
in that code block would be correct.

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.

This whole area is pretty messy, we should examine the true
intended semantics of the ifa_label stuff.


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