net/procfs: Fix some spacing when both IPv6 and IPv4 are enabled.

This commit is contained in:
Gregory Nutt 2017-07-08 11:39:59 -06:00
parent ec01bc411c
commit db278d1f4e
2 changed files with 24 additions and 13 deletions

View File

@ -900,23 +900,28 @@ Making defconfig Files
Configuring with "Compressed" defconfig Files
---------------------------------------------
2017-07-08: Currently all defconfig files are in .config form. However,
in the long term I would hope that the defconfig files will eventual
all be converted to the "compressed" defconfig format. This would be
a great savings in the total size of the NuttX files.
As described in the previous section, "Making defconfig Files," defconfig
files may be "compressed" using 'make savedeconfig'. This compressed
defconfig files are will may not be fully usable and may not build the
target binaries that you want because the compression process removed all
of the default settings from the defconfig file. To restore the default
files may be "compressed" using 'make savedeconfig'. These compressed
defconfig files may not be fully usable and may not build the target
binaries that you want because the compression process removed all of the
default settings from the defconfig file. To restore the default
settings, you should run the following after configuring:
make olddefconfig
That will restore the the missing defaulted value.
That will restore the the missing defaulted values.
Using this command after configuring is generally a good practice anyway:
Even if the defconfig files are not "compressed" in this fashion, there
the defconfig file may be old and the only way to assure that the
installed .config is via 'make oldconfig' or 'make olddefconfig'. See the
paragraph above entitled ""Refreshing Configurations" for additional
information.
Even if the defconfig files are not "compressed" in this fashion, the
defconfig file may be old and the only way to assure that the installed
.config is is uptodate is via 'make oldconfig' or 'make olddefconfig'.
See the paragraph above entitled ""Refreshing Configurations" for
additional information.
Incompatibilities with Older Configurations
-------------------------------------------

View File

@ -290,7 +290,13 @@ static int netprocfs_inet4addresses(FAR struct netprocfs_file_s *netfile)
addr.s_addr = dev->d_netmask;
len += snprintf(&netfile->line[len], NET_LINELEN - len,
"Mask:%s\n\n", inet_ntoa(addr));
#ifdef CONFIG_NET_IPv6
"Mask:%s\n", /* IPv6 addresses will follow */
#else
"Mask:%s\n\n", /* Double space at end of device description */
#endif
inet_ntoa(addr));
return len;
}
#endif
@ -319,7 +325,7 @@ static int netprocfs_inet6address(FAR struct netprocfs_file_s *netfile)
if (inet_ntop(AF_INET6, dev->d_ipv6addr, addrstr, INET6_ADDRSTRLEN))
{
len += snprintf(&netfile->line[len], NET_LINELEN - len,
"\tinet6 addr:%s/%d\n", addrstr, preflen);
"\tinet6 addr: %s/%d\n", addrstr, preflen);
}
return len;
@ -351,7 +357,7 @@ static int netprocfs_inet6draddress(FAR struct netprocfs_file_s *netfile)
if (inet_ntop(AF_INET6, dev->d_ipv6draddr, addrstr, INET6_ADDRSTRLEN))
{
len += snprintf(&netfile->line[len], NET_LINELEN - len,
"\tinet6 DRaddr:%s/%d\n\n", addrstr, preflen);
"\tinet6 DRaddr: %s/%d\n\n", addrstr, preflen);
}
return len;