summaryrefslogtreecommitdiff
path: root/lib/netdev-linux.c
diff options
context:
space:
mode:
authorBen Pfaff <blp@nicira.com>2010-09-02 10:09:09 -0700
committerBen Pfaff <blp@nicira.com>2010-09-20 09:39:54 -0700
commit2a022368f4b37559de5d5621a88c648023493f75 (patch)
treebfb5291578273782b71ad2d5fbdb72744e94d857 /lib/netdev-linux.c
parent1089aab7136612acb86cdcd638d7d2261311531a (diff)
downloadopenvswitch-2a022368f4b37559de5d5621a88c648023493f75.tar.gz
Avoid shadowing local variable names.
All of these changes avoid using the same name for two local variables within a same function. None of them are actual bugs as far as I can tell, but any of them could be confusing to the casual reader. The one in lib/ovsdb-idl.c is particularly brilliant: inner and outer loops both using (different) variables named 'i'. Found with GCC -Wshadow.
Diffstat (limited to 'lib/netdev-linux.c')
-rw-r--r--lib/netdev-linux.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/netdev-linux.c b/lib/netdev-linux.c
index e6036bfc5..7227f5dfc 100644
--- a/lib/netdev-linux.c
+++ b/lib/netdev-linux.c
@@ -1779,12 +1779,12 @@ netdev_linux_get_in6(const struct netdev *netdev_, struct in6_addr *in6)
if (file != NULL) {
const char *name = netdev_get_name(netdev_);
while (fgets(line, sizeof line, file)) {
- struct in6_addr in6;
+ struct in6_addr in6_tmp;
char ifname[16 + 1];
- if (parse_if_inet6_line(line, &in6, ifname)
+ if (parse_if_inet6_line(line, &in6_tmp, ifname)
&& !strcmp(name, ifname))
{
- netdev_dev->in6 = in6;
+ netdev_dev->in6 = in6_tmp;
break;
}
}