mirror of
https://github.com/apache/nuttx.git
synced 2026-06-04 23:03:27 +08:00
net/procfs: Fix some spacing when both IPv6 and IPv4 are enabled.
This commit is contained in:
+15
-10
@@ -900,23 +900,28 @@ Making defconfig Files
|
|||||||
Configuring with "Compressed" 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
|
As described in the previous section, "Making defconfig Files," defconfig
|
||||||
files may be "compressed" using 'make savedeconfig'. This compressed
|
files may be "compressed" using 'make savedeconfig'. These compressed
|
||||||
defconfig files are will may not be fully usable and may not build the
|
defconfig files may not be fully usable and may not build the target
|
||||||
target binaries that you want because the compression process removed all
|
binaries that you want because the compression process removed all of the
|
||||||
of the default settings from the defconfig file. To restore the default
|
default settings from the defconfig file. To restore the default
|
||||||
settings, you should run the following after configuring:
|
settings, you should run the following after configuring:
|
||||||
|
|
||||||
make olddefconfig
|
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:
|
Using this command after configuring is generally a good practice anyway:
|
||||||
Even if the defconfig files are not "compressed" in this fashion, there
|
Even if the defconfig files are not "compressed" in this fashion, the
|
||||||
the defconfig file may be old and the only way to assure that the
|
defconfig file may be old and the only way to assure that the installed
|
||||||
installed .config is via 'make oldconfig' or 'make olddefconfig'. See the
|
.config is is uptodate is via 'make oldconfig' or 'make olddefconfig'.
|
||||||
paragraph above entitled ""Refreshing Configurations" for additional
|
See the paragraph above entitled ""Refreshing Configurations" for
|
||||||
information.
|
additional information.
|
||||||
|
|
||||||
Incompatibilities with Older Configurations
|
Incompatibilities with Older Configurations
|
||||||
-------------------------------------------
|
-------------------------------------------
|
||||||
|
|||||||
@@ -290,7 +290,13 @@ static int netprocfs_inet4addresses(FAR struct netprocfs_file_s *netfile)
|
|||||||
|
|
||||||
addr.s_addr = dev->d_netmask;
|
addr.s_addr = dev->d_netmask;
|
||||||
len += snprintf(&netfile->line[len], NET_LINELEN - len,
|
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;
|
return len;
|
||||||
}
|
}
|
||||||
#endif
|
#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))
|
if (inet_ntop(AF_INET6, dev->d_ipv6addr, addrstr, INET6_ADDRSTRLEN))
|
||||||
{
|
{
|
||||||
len += snprintf(&netfile->line[len], NET_LINELEN - len,
|
len += snprintf(&netfile->line[len], NET_LINELEN - len,
|
||||||
"\tinet6 addr:%s/%d\n", addrstr, preflen);
|
"\tinet6 addr: %s/%d\n", addrstr, preflen);
|
||||||
}
|
}
|
||||||
|
|
||||||
return len;
|
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))
|
if (inet_ntop(AF_INET6, dev->d_ipv6draddr, addrstr, INET6_ADDRSTRLEN))
|
||||||
{
|
{
|
||||||
len += snprintf(&netfile->line[len], NET_LINELEN - len,
|
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;
|
return len;
|
||||||
|
|||||||
Reference in New Issue
Block a user