Message ID | 1462336172-8394-1-git-send-email-nikunj@linux.vnet.ibm.com |
---|---|
State | Rejected |
Headers | show |
On 05/04/2016 02:29 PM, Nikunj A Dadhania wrote: > Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com> > Reviewed-by: Thomas Huth <thuth@redhat.com> I do not like this one. This "localhost" is not actually 127.0.0.1 so the subj is wrong. And I am missing the point here - ping is to make the IP stack work, at least to make sure that the IP address is assigned but the patch does none of it, just replies success. > --- > clients/net-snk/app/netapps/ping.c | 6 ++++++ > 1 file changed, 6 insertions(+) > > diff --git a/clients/net-snk/app/netapps/ping.c b/clients/net-snk/app/netapps/ping.c > index 2c7dadb..4facf06 100644 > --- a/clients/net-snk/app/netapps/ping.c > +++ b/clients/net-snk/app/netapps/ping.c > @@ -180,6 +180,12 @@ ping(int argc, char *argv[]) > ((fn_ip.server_ip >> 8) & 0xFF), (fn_ip.server_ip & 0xFF)); > > > + // Report success on localhost ping > + if (memcmp(&fn_ip.server_ip, &fn_ip.own_ip, 4) == 0) { > + printf("success\n"); > + return 0; > + } > + > ping_ipv4(fd_device, fn_ip.server_ip); > > set_timer(TICKS_SEC / 10 * ping_args.timeout); >
Alexey Kardashevskiy <aik@ozlabs.ru> writes: > On 05/04/2016 02:29 PM, Nikunj A Dadhania wrote: >> Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com> >> Reviewed-by: Thomas Huth <thuth@redhat.com> > > I do not like this one. > > This "localhost" is not actually 127.0.0.1 so the subj is wrong. > > And I am missing the point here - ping is to make the IP stack work, at > least to make sure that the IP address is assigned but the patch does none > of it, just replies success. Yes, its a hack just to support if someone pings <self>, which was failing. You can drop this. Regards, Nikunj
diff --git a/clients/net-snk/app/netapps/ping.c b/clients/net-snk/app/netapps/ping.c index 2c7dadb..4facf06 100644 --- a/clients/net-snk/app/netapps/ping.c +++ b/clients/net-snk/app/netapps/ping.c @@ -180,6 +180,12 @@ ping(int argc, char *argv[]) ((fn_ip.server_ip >> 8) & 0xFF), (fn_ip.server_ip & 0xFF)); + // Report success on localhost ping + if (memcmp(&fn_ip.server_ip, &fn_ip.own_ip, 4) == 0) { + printf("success\n"); + return 0; + } + ping_ipv4(fd_device, fn_ip.server_ip); set_timer(TICKS_SEC / 10 * ping_args.timeout);