From db278d1f4eba78f20084260db266d4d8a0fd4b75 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Sat, 8 Jul 2017 11:39:59 -0600 Subject: [PATCH] net/procfs: Fix some spacing when both IPv6 and IPv4 are enabled. --- README.txt | 25 +++++++++++++++---------- net/procfs/netdev_statistics.c | 12 +++++++++--- 2 files changed, 24 insertions(+), 13 deletions(-) diff --git a/README.txt b/README.txt index e3f276661a8..88c1a9d82b4 100644 --- a/README.txt +++ b/README.txt @@ -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 ------------------------------------------- diff --git a/net/procfs/netdev_statistics.c b/net/procfs/netdev_statistics.c index 610670d25af..729a4fd5446 100644 --- a/net/procfs/netdev_statistics.c +++ b/net/procfs/netdev_statistics.c @@ -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;