Re: [PATCH] netlink: do not SIGSEGV when socket() fails

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 4 December 2013 20:12, Shawn Landden <shawn@xxxxxxxxxxxxxxx> wrote:
> ---
>  src/netlink.c | 8 ++++++--
>  1 file changed, 6 insertions(+), 2 deletions(-)
>

Hi!

I would suggest to provide a description and a Signed-off-by line
within the patch.
Also, a small trace may help others (like me) to understand the situation.

> diff --git a/src/netlink.c b/src/netlink.c
> index 533634a..664487d 100644
> --- a/src/netlink.c
> +++ b/src/netlink.c
> @@ -33,8 +33,11 @@ static struct mnl_socket *nf_sock;
>  static void __init netlink_open_sock(void)
>  {
>         nf_sock = mnl_socket_open(NETLINK_NETFILTER);
> -       if (nf_sock == NULL)
> +       if (nf_sock == NULL) {
> +                fprintf(fdopen(STDERR_FILENO, "a"), "Could not open AF_NETLINK socket: %s\n",
> +                                        strerror(errno));

In your patch, the code seem indented with spaces. Tabs are used all
around the nft code.
Also, the second line should be aligned with the position+1 of first
'(' character of fprintf.

bonus: please consider adding a tag to the [PATCH] subject, like [nft
PATCH] or [libmnl PATCH].

regards.
-- 
Arturo Borrero González
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Netfitler Users]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux