On 10/28/14 at 03:29pm, Minfei Huang wrote:
On 10/28/14 at 02:15pm, Baoquan He wrote:
On 10/23/14 at 10:47am, Minfei Huang wrote: --- a/dracut-module-setup.sh
+++ b/dracut-module-setup.sh @@ -70,14 +70,24 @@ kdump_setup_dns() { local _server _netdev _srcaddr local config_val="$1"
... skip ...
- _server=`echo $config_val | sed 's/.*@//' | cut -d':' -f1`
- _server=`get_remote_host $config_val`
- _need_dns=`echo $_server|grep "[a-zA-Z]"`
Below I have the same concerns about the "getent hosts". "getent hosts" uses gethostbyaddr() to get addr while "getent ahosts" uses getaddrinfo(). Checking manpage of gethostbyaddr(), I got below information:
The gethostbyname*() and gethostbyaddr*() functions are obsolete. Applications should use getaddrinfo(3) and getnameinfo(3) instead.
I think we should use "getent ahosts", it's the latest.
The command "getent ahosts google.com" will return the result by the order of ipv4, ipv6.
If the target has ipv6 address assigned, using the command "getent hosts google.com" will show you the ipv6 address, otherwise show you the ipv4 address.
Currently ipv6 is tried and started but still not spread out very widely and still a long time to replace ipv4. I don't find a reason ipv6 should take higher priority then ipv4 in current kdump.
So the I prefer to use the command "getent hosts" to get the default type of ip address which is assigned by the target.
Now hosts takes obsolete low level API which will be discarded and not maintained any more gradually. However ahosts is under development. From man page this is clear. Though there isn't other better reason we should use ahosts, we also can't find even a good reason to tell we should not take ahosts and continue using hosts.
So I insist we should use ahosts to replace hosts.
Thanks Baoquan
- [ -n "$_need_dns" ] && _server=`getent hosts $_server|cut -d' ' -f1`
- if is_ipv6_target; then
_need_dns=`echo $_server|grep "[:]"`
@@ -583,6 +612,8 @@ install() { inst "/bin/date" "/bin/date" inst "/bin/sync" "/bin/sync" inst "/bin/cut" "/bin/cut"
- inst "/bin/getent" "/bin/getent"
In dracut-module-setup.sh there has been a getent calling, do we have to include it again?
- inst "/bin/head" "/bin/head" inst "/sbin/makedumpfile" "/sbin/makedumpfile"
... skip ...
kexec@lists.fedoraproject.org https://lists.fedoraproject.org/mailman/listinfo/kexec
kexec mailing list kexec@lists.fedoraproject.org https://lists.fedoraproject.org/mailman/listinfo/kexec