Re: [iptables-nftables PATCH 3/5] nft: nft_xtables_config_load() called only in nft_init()

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

 



Hi Giuseppe,

On Fri, Jul 26, 2013 at 01:05:17PM +0200, Giuseppe Longo wrote:
[...]
> diff --git a/iptables/xtables-config.c b/iptables/xtables-config.c
> index b7cf609..d61b762 100644
> --- a/iptables/xtables-config.c
> +++ b/iptables/xtables-config.c
> @@ -15,6 +15,7 @@
>  #include <stdbool.h>
>  #include <string.h>
>  #include <errno.h>
> +#include <libmnl/libmnl.h>
>  
>  #include "xtables-multi.h"
>  #include "nft.h"
> @@ -35,11 +36,17 @@ int xtables_config_main(int argc, char *argv[])
>  	else
>  		filename = argv[1];
>  
> -	if (nft_init(&h, xtables_ipv4) < 0) {
> -                fprintf(stderr, "Failed to initialize nft: %s\n",
> -			strerror(errno));
> -		return EXIT_FAILURE;
> +	h.nl = mnl_socket_open(NETLINK_NETFILTER);
> +	if (h.nl == NULL) {
> +		perror("mnl_socket_open");
> +		return -1;
>  	}
> +	if (mnl_socket_bind(h.nl, 0, MNL_SOCKET_AUTOPID) < 0) {
> +		perror("mnl_socket_bind");
> +		return -1;
> +	}
> +	h.portid = mnl_socket_get_portid(h.nl);
> +	h.tables = xtables_ipv4;

Hm, why do we need this here?
--
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