All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: ip6tables icmpv6 match
@ 2006-03-29  7:25 Yasuyuki KOZAKAI
  2006-04-07 11:31 ` [PATCH 1/4] fix loading shared library of ICMPv6 match Yasuyuki KOZAKAI
  0 siblings, 1 reply; 2+ messages in thread
From: Yasuyuki KOZAKAI @ 2006-03-29  7:25 UTC (permalink / raw)
  To: danieldegraaf; +Cc: netfilter-devel

[-- Attachment #1: Type: Text/Plain, Size: 610 bytes --]


Hi, Daniel and all,

From: "Daniel De Graaf" <danieldegraaf@gmail.com>
Date: Sun, 26 Mar 2006 22:19:27 -0600

> libip6t_icmpv6.c registers a match called "icmp6", which means that
> ip6tables -vL and ip6tables-save cannot output the match correctly.

There are 2 solutions.

	1. just rename libip6t_icmpv6.c to libip6t_icmp6.c. This can
	   conform names of internal structure, library and kernel module.
	2. apply attached patch to fix find_match() so that ip6tables can
	   load libip6t_icmpv6.so.

I like 1 but I'm not sure we can do it. Anyone knows any historical
problem about it ?

-- Yasuyuki Kozakai

[-- Attachment #2: fix-icmpv6.patch --]
[-- Type: Text/Plain, Size: 2177 bytes --]

[PATCH] fix loading libip6t_icmpv6.so

The current ip6tables fails to load libip6t_icmp6.so wehn user tries
'-p icmpv6', '-m icmpv6', or '-m icmp6'.

To fix this and keep compatibility,
	- 'name' in 'struct ip6tables_match icmpv6' must be 'icmp6'.
	  This name is used in kernel.
	- Then ip6tables should use the name 'icmp6' to search match in list.
	- ip6tables should try to load libip6t_icmpv6.so, not libip6t_icmp6.so.

---
commit 985c7966e4dcacbd7511afd5df86878652b946d6
tree 41192f2b1b4d46d0947b81bc888e0bfba3ab8e27
parent c94b52d4b6fff1bfc2da3e192b39e0f45cd12750
author Yasuyuki Kozakai <yasuyuki.kozakai@toshiba.co.jp> Wed, 29 Mar 2006 12:06:44 +0900
committer Yasuyuki Kozakai <yasuyuki.kozakai@toshiba.co.jp> Wed, 29 Mar 2006 12:06:44 +0900

 ip6tables.c |   14 +++++++++-----
 1 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/ip6tables.c b/ip6tables.c
index dcf7d36..34506f5 100644
--- a/ip6tables.c
+++ b/ip6tables.c
@@ -713,16 +713,20 @@ find_match(const char *match_name, enum 
 {
 	struct ip6tables_match *ptr;
  	const char *icmp6 = "icmp6";
- 	const char *name;
+ 	const char *icmpv6 = "icmpv6";
+ 	const char *name, *libname;
   
 	/* This is ugly as hell. Nonetheless, there is no way of changing
 	 * this without hurting backwards compatibility */
  	if ( (strcmp(match_name,"icmpv6") == 0) ||
  	     (strcmp(match_name,"ipv6-icmp") == 0) ||
- 	     (strcmp(match_name,"icmp6") == 0) )
+ 	     (strcmp(match_name,"icmp6") == 0) ) {
  	     	name = icmp6;
- 	else
+		libname = icmpv6;
+ 	} else {
  		name = match_name;
+		libname = match_name;
+	}
  
 	for (ptr = ip6tables_matches; ptr; ptr = ptr->next) {
  		if (strcmp(name, ptr->name) == 0) {
@@ -747,8 +751,8 @@ find_match(const char *match_name, enum 
 #ifndef NO_SHARED_LIBS
 	if (!ptr && tryload != DONT_LOAD && tryload != DURING_LOAD) {
 		char path[strlen(lib_dir) + sizeof("/libip6t_.so")
-			 + strlen(name)];
-		sprintf(path, "%s/libip6t_%s.so", lib_dir, name);
+			 + strlen(libname)];
+		sprintf(path, "%s/libip6t_%s.so", lib_dir, libname);
 		if (dlopen(path, RTLD_NOW)) {
 			/* Found library.  If it didn't register itself,
 			   maybe they specified target as match. */

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2006-04-07 12:37 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <200604071131.k37BV2wB005845@toshiba.co.jp>
2006-04-07 12:37 ` [PATCH 1/4] fix loading shared library of ICMPv6 match Patrick McHardy
2006-03-29  7:25 ip6tables icmpv6 match Yasuyuki KOZAKAI
2006-04-07 11:31 ` [PATCH 1/4] fix loading shared library of ICMPv6 match Yasuyuki KOZAKAI

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.