[SLOF] [PATCH v4 2/3] ping: add netmask in the ping argument

Thomas Huth thuth at redhat.com
Tue May 3 21:05:00 AEST 2016


On 03.05.2016 10:24, Nikunj A Dadhania wrote:
> The current ping command does not take netmask as argument, updated the
> ping command to take "client-ip/nn" format ip address.
> 
> Add routine to return netmask(class based), when not provided by user.
> 
> Signed-off-by: Nikunj A Dadhania <nikunj at linux.vnet.ibm.com>
> ---
>  clients/net-snk/app/netapps/args.c | 44 ++++++++++++++++++++++++++++++++++----
>  clients/net-snk/app/netapps/args.h |  1 +
>  clients/net-snk/app/netapps/ping.c | 21 ++++++++++++++++--
>  clients/net-snk/app/netlib/ipv4.c  | 21 ++++++++++++++++++
>  clients/net-snk/app/netlib/ipv4.h  |  1 +
>  slof/fs/loaders.fs                 |  4 ++--
>  6 files changed, 84 insertions(+), 8 deletions(-)
[...]
> +/**
> + * Converts "255.255.255.255" -> char[4] = { 0xff, 0xff, 0xff, 0xff }
> + *
> + * @param  str        string to be converted
> + * @param  ip         in case of SUCCESS - 32-bit long IP
> + in case of FAULT - zero

Missing indentation?

> + * @return            TRUE - IP converted successfully;
> + *                    FALSE - error condition occurs (e.g. bad format)
> + */
> +int
> +strtoip(const char *str, char ip[4])
> +{
> +	return strtoip_netmask(str, ip, NULL);
> +}

Apart from that minor nit above, the patch looks fine to me now, so feel
free to add my:

Reviewed-by: Thomas Huth <thuth at redhat.com>



More information about the SLOF mailing list