[PATCH 01/**] libxt_*.so lookup

Jan Engelhardt jengelh at computergmbh.de
Wed Aug 1 17:02:16 CEST 2007


On Aug 1 2007 23:40, Yasuyuki KOZAKAI wrote:
>
>The argument 'family' has no effect. And this change makes possible to
>remove links from libxt_*.so to libip[6]t_*.so as you proposed.

Ah indeed.

>index baee483..58b4e81 100644
>--- a/xtables.c
>+++ b/xtables.c
>@@ -292,18 +292,21 @@ struct xtables_match *find_match(const char *name, enum xt_tryload tryload,
> 	if (!ptr && tryload != DONT_LOAD && tryload != DURING_LOAD) {
> 		char path[strlen(lib_dir) + sizeof("/.so")
> 			  + strlen(afinfo.libprefix) + strlen(name)];
>-		sprintf(path, "%s/%s%s.so", lib_dir, afinfo.libprefix,
>-			name);
>-		if (dlopen(path, RTLD_NOW)) {
>+
>+		sprintf(path, "%s/libxt_%s.so", lib_dir, name);
>+		if (dlopen(path, RTLD_NOW) != NULL)

I'd suggest using snprintf(). (Also elsewhere)
But looks ok otherwise.


	Jan
-- 



More information about the netfilter-devel mailing list