]> granicus.if.org Git - ipset/log
ipset
13 years agonetfilter:ipset: fix the compile warning in ip_set_create
Shan Wei [Fri, 4 Mar 2011 07:34:35 +0000 (15:34 +0800)]
netfilter:ipset: fix the compile warning in ip_set_create

net/netfilter/ipset/ip_set_core.c:615: warning: ?clash? may be used uninitialized in this function

Signed-off-by: shanw <shanw@shanw-desktop.(none)>
Signed-off-by: Jozsef Kadlecsik <kadlec@blackhole.kfki.hu>
13 years agoipset 6.0 released v6.0
Jozsef Kadlecsik [Thu, 3 Feb 2011 12:40:23 +0000 (13:40 +0100)]
ipset 6.0 released

13 years agoPrint protocol version together with ipset version
Jozsef Kadlecsik [Thu, 3 Feb 2011 12:05:22 +0000 (13:05 +0100)]
Print protocol version together with ipset version

13 years agoReorganized kernel/ subdir
Jozsef Kadlecsik [Thu, 3 Feb 2011 10:44:27 +0000 (11:44 +0100)]
Reorganized kernel/ subdir

The kernel/ subdirectory is reorganized to follow the kernel directory
structure.

13 years agonetfilter: ipset: fix linking with CONFIG_IPV6=n
Patrick McHardy [Thu, 3 Feb 2011 09:27:49 +0000 (10:27 +0100)]
netfilter: ipset: fix linking with CONFIG_IPV6=n

Add some #ifdefs to unconditionally return false in
ip_set_get_ip6_port() when CONFIG_IPV6=n and convert
to ipv6_skip_exthdr() to avoid pulling in the ip6_tables
module when loading ipset.

Signed-off-by: Patrick McHardy <kaber@trash.net>
13 years agonetfilter: ipset: send error message manually
Jozsef Kadlecsik [Wed, 2 Feb 2011 19:43:18 +0000 (20:43 +0100)]
netfilter: ipset: send error message manually

When a message carries multiple commands and one of them triggers
an error, we have to report to the userspace which one was that.
The line number of the command plays this role and there's an attribute
reserved in the header part of the message to be filled out with the error
line number. In order not to modify the original message received from
the userspace, we construct a new, complete netlink error message and
modifies the attribute there, then send it.
Netlink is notified not to send its ACK/error message.

13 years agonetfilter: ipset: add missing break statemtns in ip_set_get_ip_port()
Patrick McHardy [Wed, 2 Feb 2011 19:40:12 +0000 (20:40 +0100)]
netfilter: ipset: add missing break statemtns in ip_set_get_ip_port()

Don't fall through in the switch statement, otherwise IPv4 headers
are incorrectly parsed again as IPv6 and the return value will always
be 'false'.

Signed-off-by: Patrick McHardy <kaber@trash.net>
13 years agonetfilter: ipset: add missing include to xt_set.h
Patrick McHardy [Tue, 1 Feb 2011 19:55:58 +0000 (20:55 +0100)]
netfilter: ipset: add missing include to xt_set.h

Signed-off-by: Patrick McHardy <kaber@trash.net>
13 years agonetfilter: ipset: remove unnecessary includes
Patrick McHardy [Tue, 1 Feb 2011 19:53:53 +0000 (20:53 +0100)]
netfilter: ipset: remove unnecessary includes

None of the set types need uaccess.h since this is handled centrally
in ip_set_core. Most set types additionally don't need bitops.h and
spinlock.h since they use neither. tcp.h is only needed by those
using before(), udp.h is not needed at all.

Signed-off-by: Patrick McHardy <kaber@trash.net>
13 years agonetfilter: ipset: use nla_parse_nested()
Patrick McHardy [Tue, 1 Feb 2011 19:51:56 +0000 (20:51 +0100)]
netfilter: ipset: use nla_parse_nested()

Replace calls of the form:

nla_parse(tb, ATTR_MAX, nla_data(attr), nla_len(attr), policy)

by:

nla_parse_nested(tb, ATTR_MAX, attr, policy)

Signed-off-by: Patrick McHardy <kaber@trash.net>
13 years agoTestsuite compatibility with debugging enabled
Jozsef Kadlecsik [Tue, 1 Feb 2011 19:37:42 +0000 (20:37 +0100)]
Testsuite compatibility with debugging enabled

The error line checking would fail when debugging is enabled
(and spit out junk lines), fixed.

13 years agoAllow "new" as a commad alias to "create"
Jozsef Kadlecsik [Tue, 1 Feb 2011 19:35:33 +0000 (20:35 +0100)]
Allow "new" as a commad alias to "create"

It's too easy to mistype "n" to "new", so just allow it.

13 years agoipset: improve command argument parsing
Holger Eitzenberger [Tue, 1 Feb 2011 17:13:10 +0000 (18:13 +0100)]
ipset: improve command argument parsing

The number of comparisons for a matching a command name can be
made smaller by just checking on argv[1].

As an example consider the following 'create' arguments 'hashsize',
'family' and 'timeout'.  When having the command

 create foo hash:ip timeout 60 family inet hashsize 64

it compares without this patch:

 strcmp("timeout", "hashsize")
 strcmp("64", "hashsize")
 strcmp("family", "hashsize")
 strcmp("inet", "hashsize")
 strcmp("hashsize", "hashsize")

It is worse in practice, as 'create' has more arguments than this.

Signed-off-by: Holger Eitzenberger <holger@eitzenberger.org>
13 years agoipset: avoid the unnecessary argv[] loop
Holger Eitzenberger [Mon, 24 Jan 2011 21:36:35 +0000 (22:36 +0100)]
ipset: avoid the unnecessary argv[] loop

After stripping off the global options there simply has to follow
a command name, there is no other syntax possible.  Therefore the
argv[] loop is unnecessary.

Signed-off-by: Holger Eitzenberger <holger@eitzenberger.org>
13 years agoipset: pass ipset_arg argument pointer
Holger Eitzenberger [Tue, 1 Feb 2011 16:30:57 +0000 (17:30 +0100)]
ipset: pass ipset_arg argument pointer

Signed-off-by: Holger Eitzenberger <holger@eitzenberger.org>
13 years agoSeparate ipset errnos completely from system ones and bump protocol version.
Jozsef Kadlecsik [Mon, 31 Jan 2011 22:32:51 +0000 (23:32 +0100)]
Separate ipset errnos completely from system ones and bump protocol version.

13 years agoUse better error codes in xt_set.c
Jozsef Kadlecsik [Mon, 31 Jan 2011 22:30:31 +0000 (23:30 +0100)]
Use better error codes in xt_set.c

13 years agoFix sparse warning about shadowed definition
Jozsef Kadlecsik [Thu, 27 Jan 2011 21:22:26 +0000 (22:22 +0100)]
Fix sparse warning about shadowed definition

13 years agobitmap:ip type: flavour specific adt functions
Jozsef Kadlecsik [Thu, 27 Jan 2011 21:17:38 +0000 (22:17 +0100)]
bitmap:ip type: flavour specific adt functions

Use flavour-specific ADT functions and use shared ones for all
other type functions (Patrick McHardy's review)

13 years agobitmap:port type: flavour specific adt functions
Jozsef Kadlecsik [Thu, 27 Jan 2011 20:54:21 +0000 (21:54 +0100)]
bitmap:port type: flavour specific adt functions

Use flavour-specific ADT functions and use shared ones for all
other type functions (Patrick McHardy's review)

13 years agoMove the type specifici attribute validation to the core
Jozsef Kadlecsik [Thu, 27 Jan 2011 11:44:17 +0000 (12:44 +0100)]
Move the type specifici attribute validation to the core

The type specific attribute validation can be moved to the ipset core.
That way it's done centrally and thus can be eliminated from the individual
set types (suggested by Patrick McHardy).

13 years agoFix the spelling error fix :-)
Jozsef Kadlecsik [Wed, 26 Jan 2011 22:50:56 +0000 (23:50 +0100)]
Fix the spelling error fix :-)

Spelling error fixed (Ferenc Wagner)

13 years agoUse vzalloc() instead of __vmalloc()
Jozsef Kadlecsik [Wed, 26 Jan 2011 22:47:20 +0000 (23:47 +0100)]
Use vzalloc() instead of __vmalloc()

Use vzalloc() if kernel version supports it. (Eric Dumazet, Patrick McHardy)

13 years agoUse meaningful error messages in xt_set.c
Jozsef Kadlecsik [Wed, 26 Jan 2011 22:22:58 +0000 (23:22 +0100)]
Use meaningful error messages in xt_set.c

Old cryptic error messages are not useful (Patrick McHardy's review)

13 years agoConstified attribute cannot be written
Jozsef Kadlecsik [Wed, 26 Jan 2011 21:59:25 +0000 (22:59 +0100)]
Constified attribute cannot be written

Attribute is const so a little bit more work is needed to return
the error line number. A test is also added in order to check
the functionality. (Patrick McHardy's review)

13 years agoSend (N)ACK at dumping only when NLM_F_ACK is set
Jozsef Kadlecsik [Wed, 26 Jan 2011 21:37:11 +0000 (22:37 +0100)]
Send (N)ACK at dumping only when NLM_F_ACK is set

Missing check of the flag NLM_F_ACK is added to the kernel -
and userspace does set it too (Patrick McHardy's review)

13 years agoCorrect the error codes: use ENOENT and EMSGSIZE
Jozsef Kadlecsik [Wed, 26 Jan 2011 21:26:01 +0000 (22:26 +0100)]
Correct the error codes: use ENOENT and EMSGSIZE

Use correct error codes (Patrick McHardy's review)

13 years agoResolving IP addresses did not work at listing/saving sets, fixed.
Jozsef Kadlecsik [Wed, 26 Jan 2011 20:49:30 +0000 (21:49 +0100)]
Resolving IP addresses did not work at listing/saving sets, fixed.

13 years agoipset: fix spelling error
Holger Eitzenberger [Mon, 24 Jan 2011 21:36:37 +0000 (22:36 +0100)]
ipset: fix spelling error

Signed-off-by: Holger Eitzenberger <holger@eitzenberger.org>
Signed-off-by: Jozsef Kadlecsik <kadlec@blackhole.kfki.hu>
13 years agoipset: fix the Netlink sequence number
Holger Eitzenberger [Mon, 24 Jan 2011 21:36:33 +0000 (22:36 +0100)]
ipset: fix the Netlink sequence number

Do not use time() as a Netlink sequence number for each message,
as otherwise the same seq number will be used when sending
another message in the same second.  Instead use time() just for
initialization, then increment per message.

Signed-off-by: Holger Eitzenberger <holger@eitzenberger.org>
Signed-off-by: Jozsef Kadlecsik <kadlec@blackhole.kfki.hu>
13 years agoipset: turn Set name[] into a const pointer
Holger Eitzenberger [Mon, 24 Jan 2011 21:36:32 +0000 (22:36 +0100)]
ipset: turn Set name[] into a const pointer

Also check for the name length.

Note that passing errno values back is not done consistently at
various place, as there are some functions which set errno manually,
others pass -errno back.  I use the -errno approach here, as it is
slightly shorter.

Signed-off-by: Holger Eitzenberger <holger@eitzenberger.org>
Signed-off-by: Jozsef Kadlecsik <kadlec@blackhole.kfki.hu>
13 years agoCheck ICMP and ICMPv6 with the set match and target in the testsuite
Jozsef Kadlecsik [Mon, 24 Jan 2011 17:14:01 +0000 (18:14 +0100)]
Check ICMP and ICMPv6 with the set match and target in the testsuite

"sendip" needs data otherwise ICMP/ICMPv6 gets truncated...

13 years agoAvoid possible syntax clashing at saving hostnames
Jozsef Kadlecsik [Mon, 24 Jan 2011 16:38:26 +0000 (17:38 +0100)]
Avoid possible syntax clashing at saving hostnames

If resolving is requested and the resolved hostname contains a dash
character, print the unresolved IP address instead in order not to
clash with the IP/hostname range syntax.

13 years agoipset 5.4.1 released v5.4.1
Jozsef Kadlecsik [Sat, 22 Jan 2011 09:35:45 +0000 (10:35 +0100)]
ipset 5.4.1 released

13 years agoAdd UPGRADE instructions
Jozsef Kadlecsik [Sat, 22 Jan 2011 09:31:08 +0000 (10:31 +0100)]
Add UPGRADE instructions

13 years agoipset 5.4 released v5.4
Jozsef Kadlecsik [Fri, 21 Jan 2011 21:47:01 +0000 (22:47 +0100)]
ipset 5.4 released

13 years agoFixed broken ICMP and ICMPv6 handling
Jozsef Kadlecsik [Fri, 21 Jan 2011 20:29:50 +0000 (21:29 +0100)]
Fixed broken ICMP and ICMPv6 handling

I mistyped the bitwise operator and the network-order conversion was
missing too. Sigh, sendip cannot generate proper packets to check
ICMP and ICMPv6 in the testsuite. :-(

13 years agoFix trailing whitespaces and pr_* messages
Jozsef Kadlecsik [Fri, 21 Jan 2011 10:39:56 +0000 (11:39 +0100)]
Fix trailing whitespaces and pr_* messages

Some trailing whitespace slipped in, those are removed. With the deleted
ip_set_kernel.h, the pr_* messages lost the trailing "\n" character.
The messages were completed with it.

13 years agoUn-inline functions which are not small enough
Jozsef Kadlecsik [Thu, 20 Jan 2011 22:10:26 +0000 (23:10 +0100)]
Un-inline functions which are not small enough

13 years agoFix module loading at create/header commands
Jozsef Kadlecsik [Thu, 20 Jan 2011 21:24:03 +0000 (22:24 +0100)]
Fix module loading at create/header commands

While holding the nfnl_mutex, module loading is not allowed.
Bug spotted by Patrick McHardy in his reviewing.

13 years agoFix wrong kzalloc flag in type_pf_expire
Jozsef Kadlecsik [Thu, 20 Jan 2011 17:55:48 +0000 (18:55 +0100)]
Fix wrong kzalloc flag in type_pf_expire

The expire functions of the hash types are called while locked, so
kzalloc must be called with GFP_ATOMIC.

13 years agoThe get_ip*_port functions are too large to be inlined, moved into the core.
Jozsef Kadlecsik [Thu, 20 Jan 2011 17:51:54 +0000 (18:51 +0100)]
The get_ip*_port functions are too large to be inlined, moved into the core.

13 years agoAdd missing __GFP_HIGHMEM flag to __vmalloc
Jozsef Kadlecsik [Thu, 20 Jan 2011 17:19:31 +0000 (18:19 +0100)]
Add missing __GFP_HIGHMEM flag to __vmalloc

We may call ip_set_alloc with GFP_ATOMIC, so we cannot replace __vmalloc
with vzalloc. Missing flag was noticed by Eric Dumazet.

13 years agoEnforce network-order data in the netlink protocol
Jozsef Kadlecsik [Thu, 20 Jan 2011 16:54:26 +0000 (17:54 +0100)]
Enforce network-order data in the netlink protocol

Allow only network-order data, with NLA_F_NET_BYTEORDER flag.
Sanity checks also added to prevent processing broken messages
where mandatory attributes are missing. (Patrick McHardy's review)

13 years agoUse annotated types and fix sparse warnings
Jozsef Kadlecsik [Thu, 20 Jan 2011 13:48:23 +0000 (14:48 +0100)]
Use annotated types and fix sparse warnings

Annotated types are introduced and sparse warnings fixed.
Two warnings remained in ip_set_core.c but those are false ones.
(Patrick McHardy's review)

13 years agoMove ip_set_alloc, ip_set_free and ip_set_get_ipaddr* into core
Jozsef Kadlecsik [Thu, 20 Jan 2011 10:45:37 +0000 (11:45 +0100)]
Move ip_set_alloc, ip_set_free and ip_set_get_ipaddr* into core

The functions are too large to be inlined, so move them into the core.
Also, fix the unnecessary initializations in ip_set_get_ipaddr*.
(Patrick McHardy's review)

13 years agoNETMASK*, HOSTMASK* macros are too generic
Jozsef Kadlecsik [Thu, 20 Jan 2011 10:34:00 +0000 (11:34 +0100)]
NETMASK*, HOSTMASK* macros are too generic

NETMASK*, HOSTMASK* macros are rewritten to small inline functions
ip_set_netmask* and ip_set_hostmask* (Patrick McHardy's review)

13 years agoUse static LIST_HEAD() for ip_set_type_list
Jozsef Kadlecsik [Thu, 20 Jan 2011 09:58:43 +0000 (10:58 +0100)]
Use static LIST_HEAD() for ip_set_type_list

Avoid the need for explicit initialization during runtime
(Patrick McHardy's review)

13 years agoMove NLA_PUT_NET* macros to include/net/netlink.h
Jozsef Kadlecsik [Thu, 20 Jan 2011 09:39:01 +0000 (10:39 +0100)]
Move NLA_PUT_NET* macros to include/net/netlink.h

These macros can be useful in general (Patrick McHardy's review)

13 years agoThe module parameter max_sets should be unsigned int
Jozsef Kadlecsik [Thu, 20 Jan 2011 09:26:44 +0000 (10:26 +0100)]
The module parameter max_sets should be unsigned int

Negative set numbers are strange :-) (Patrick McHardy's review)

13 years agoGet rid of ip_set_kernel.h
Jozsef Kadlecsik [Thu, 20 Jan 2011 09:25:04 +0000 (10:25 +0100)]
Get rid of ip_set_kernel.h

The header file was useful at deep debugging only, we can get rid of now.
(Patrick McHardy's review)

13 years agoFix the placement style of boolean operators at continued lines
Jozsef Kadlecsik [Thu, 20 Jan 2011 09:20:14 +0000 (10:20 +0100)]
Fix the placement style of boolean operators at continued lines

Fix "&&" and "||" continuation style (Patrick McHardy's review)

13 years agoipset 5.3 released v5.3
Jozsef Kadlecsik [Tue, 18 Jan 2011 19:47:44 +0000 (20:47 +0100)]
ipset 5.3 released

13 years agoSet the non-debug compiling the default
Jozsef Kadlecsik [Tue, 18 Jan 2011 19:39:51 +0000 (20:39 +0100)]
Set the non-debug compiling the default

Compiling with debugging can be enabled with the "--enable-debug" option
of the configure script.

13 years agoTestsuite fix of ospf replaced with vrrp.
Jozsef Kadlecsik [Tue, 18 Jan 2011 16:49:55 +0000 (17:49 +0100)]
Testsuite fix of ospf replaced with vrrp.

The testsuite failed incorrectly, because the order of the elements
changed.

13 years agoFix build with NDEBUG defined
Jozsef Kadlecsik [Tue, 18 Jan 2011 16:48:22 +0000 (17:48 +0100)]
Fix build with NDEBUG defined

The usage of the gcc option -Wunused-parameter interferes badly with
the assert() macros.  In case -DNDEBUG is specified build fails with:

  cc1: warnings being treated as errors
  print.c: In function 'ipset_print_family':
  print.c:92: error: unused parameter 'opt'
  print.c: In function 'ipset_print_port':
  print.c:413: error: unused parameter 'opt'
  print.c: In function 'ipset_print_proto':

Fix it by taking into accout NDEBUG in the function arguments.

Bug reported by Holger Eitzenberger.

13 years agoDo session initialization once
Holger Eitzenberger [Tue, 18 Jan 2011 16:30:50 +0000 (17:30 +0100)]
Do session initialization once

Signed-off-by: Jozsef Kadlecsik <kadlec@blackhole.kfki.hu>
13 years agoMake IPv4 and IPv6 address handling similar
Jozsef Kadlecsik [Tue, 18 Jan 2011 16:20:30 +0000 (17:20 +0100)]
Make IPv4 and IPv6 address handling similar

While the following works for AF_INET:

 ipset add foo 192.168.1.1/32

this does not work for AF_INET6:

 ipset add foo6 20a1:1:2:3:4:5:6:7/128
 ipset v5.2: Syntax error: plain IP address must be supplied: 20a1:1:2:3:4:5:6:7/128

Bug reported by Holger Eitzenberger.

The complete fix is to handle the special host prefixes in the general
IP address parser function.

13 years agoShow correct line numbers in restore output for parser errors
Jozsef Kadlecsik [Tue, 18 Jan 2011 16:17:46 +0000 (17:17 +0100)]
Show correct line numbers in restore output for parser errors

Parser errors are reported by a wrong lineno at restore, bug reported
by Holger Eitzenberger:

  create foo6 hash:ip hashsize 64 family inet6
  add foo6 20a1:1234:5678::/64
  add foo6 20a1:1234:5679::/64

you get:

  ipset v5.2: Error in line 1: Syntax error: plain IP address must be supplied: 20a1:1234:5678::/64

Should be line 2 though.

The solution is to set the session lineno before parsing.

13 years agoThere is no need to call synchronize_net() at swapping.
Jozsef Kadlecsik [Fri, 14 Jan 2011 18:30:28 +0000 (19:30 +0100)]
There is no need to call synchronize_net() at swapping.

Ongoing add/del can happen to referenced sets and delete can be issued
to unreferenced sets. So the bogus call to synchronize_net() can safely
be removed.

13 years agoReplace strncpy with strlcpy at creating a set.
Jozsef Kadlecsik [Fri, 14 Jan 2011 16:24:38 +0000 (17:24 +0100)]
Replace strncpy with strlcpy at creating a set.

Better add more safety nets against user input.

13 years agoUpdate copyright date and some style changes.
Jozsef Kadlecsik [Fri, 14 Jan 2011 16:16:10 +0000 (17:16 +0100)]
Update copyright date and some style changes.

13 years agoUse jhash.h accepted in kernel, with backward compatibility.
Jozsef Kadlecsik [Thu, 13 Jan 2011 21:01:51 +0000 (22:01 +0100)]
Use jhash.h accepted in kernel, with backward compatibility.

13 years agoSeparate prefixlens from ip_set core.
Jozsef Kadlecsik [Thu, 13 Jan 2011 20:48:17 +0000 (21:48 +0100)]
Separate prefixlens from ip_set core.

Separate prefixlens from ip_set core for better readibility and honoring
the independence.
Also, comment that prefixlens were borrowed from Jan Engelhardt.

13 years agoReplace ospf with vrrp in the testsuite
Jozsef Kadlecsik [Thu, 13 Jan 2011 14:46:26 +0000 (15:46 +0100)]
Replace ospf with vrrp in the testsuite

Some systems do not contain ospf in /etc/protocols but ospfigp only.

13 years agoMerge branch 'master' of git://dev.medozas.de/ipset
Jozsef Kadlecsik [Wed, 12 Jan 2011 12:33:11 +0000 (13:33 +0100)]
Merge branch 'master' of git://dev.medozas.de/ipset

Signed-off-by: Jozsef Kadlecsik <kadlec@blackhole.kfki.hu>
13 years agokernel: remove unused ctnl parameter from call_ad
Jan Engelhardt [Mon, 3 Jan 2011 21:32:41 +0000 (22:32 +0100)]
kernel: remove unused ctnl parameter from call_ad

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
13 years agoMerge branch 'master' of git://dev.medozas.de/ipset
Jozsef Kadlecsik [Mon, 3 Jan 2011 09:07:40 +0000 (10:07 +0100)]
Merge branch 'master' of git://dev.medozas.de/ipset

Signed-off-by: Jozsef Kadlecsik <kadlec@blackhole.kfki.hu>
13 years agobuild: remove autogenerated files
Jan Engelhardt [Thu, 30 Dec 2010 23:23:25 +0000 (00:23 +0100)]
build: remove autogenerated files

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
13 years agobuild: use only AC_CANONICAL_HOST
Jan Engelhardt [Thu, 30 Dec 2010 23:19:23 +0000 (00:19 +0100)]
build: use only AC_CANONICAL_HOST

Calculating AC_CANONICAL_TARGET is superfluous, because ipset is not a
code generator.

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
13 years agoComment the possible return values of the add/del/test type-functions
Jozsef Kadlecsik [Thu, 23 Dec 2010 20:39:12 +0000 (21:39 +0100)]
Comment the possible return values of the add/del/test type-functions

13 years agoipset 5.2 released v5.2
Jozsef Kadlecsik [Thu, 23 Dec 2010 14:48:56 +0000 (15:48 +0100)]
ipset 5.2 released

13 years agoHandle internal printing errors
Jozsef Kadlecsik [Thu, 23 Dec 2010 14:28:28 +0000 (15:28 +0100)]
Handle internal printing errors

Internal printing errors were not reported, handle them by setjmp/longjmp.

13 years agoUse cast to void * instead of memcpy as Sparc workaround at sockaddr_XXX.
Jozsef Kadlecsik [Thu, 23 Dec 2010 13:44:44 +0000 (14:44 +0100)]
Use cast to void * instead of memcpy as Sparc workaround at sockaddr_XXX.

Direct cast results "cast increases required alignment of target type" on
Sparc: use indirect cast to void * instead of memcpy, as Jan Engelhardt
suggested.

13 years agoListing/saving of large sets could produce broken listing, fixed.
Jozsef Kadlecsik [Thu, 23 Dec 2010 13:33:16 +0000 (14:33 +0100)]
Listing/saving of large sets could produce broken listing, fixed.

The wrapper around getnameinfo was not snprintf-compatible and
that could cause broken listing/saving for large sets.

13 years agoKernel version check at minimal supported version is mistyped, now fixed.
Jozsef Kadlecsik [Wed, 22 Dec 2010 20:57:01 +0000 (21:57 +0100)]
Kernel version check at minimal supported version is mistyped, now fixed.

13 years agoSupport libtool < 2.2
Jozsef Kadlecsik [Wed, 22 Dec 2010 20:49:34 +0000 (21:49 +0100)]
Support libtool < 2.2

LT_INIT is not present before libtool 2.2. Revert to use AC_PROG_LIBTOOL.

13 years agoipset 5.1 released v5.1
Jozsef Kadlecsik [Wed, 22 Dec 2010 10:09:20 +0000 (11:09 +0100)]
ipset 5.1 released

13 years agoTest cases for IPv6 restore and more complex restore sessions added.
Jozsef Kadlecsik [Wed, 22 Dec 2010 09:46:26 +0000 (10:46 +0100)]
Test cases for IPv6 restore and more complex restore sessions added.

13 years agoRestore mode did not work for IPv6 (reported by Elie Rosenblum)
Jozsef Kadlecsik [Wed, 22 Dec 2010 09:43:05 +0000 (10:43 +0100)]
Restore mode did not work for IPv6 (reported by Elie Rosenblum)

The set cache stored the default family (INET) instead of the set family,
therefore restore mode for IPv6 did not work. The set cache fixed and
message aggregation reworked.

13 years agoKernel version compatibility: support from 2.6.34
Jozsef Kadlecsik [Tue, 21 Dec 2010 19:47:08 +0000 (20:47 +0100)]
Kernel version compatibility: support from 2.6.34

The basic kernel compatibility issues are verified back to 2.6.24.
The minimal supported kernel version had to be bumped from 2.6.31 to 2.6.34.

13 years agoMerge branch 'master' of git://dev.medozas.de/ipset into ipset-5
Jozsef Kadlecsik [Mon, 20 Dec 2010 10:54:26 +0000 (11:54 +0100)]
Merge branch 'master' of git://dev.medozas.de/ipset into ipset-5

Signed-off-by: Jozsef Kadlecsik <kadlec@blackhole.kfki.hu>
13 years agolibipset: static annotations
Jan Engelhardt [Sun, 19 Dec 2010 04:57:52 +0000 (05:57 +0100)]
libipset: static annotations

13 years agolibipset: const annotations
Jan Engelhardt [Sun, 19 Dec 2010 04:56:19 +0000 (05:56 +0100)]
libipset: const annotations

13 years agolibipset: remove redundant casts
Jan Engelhardt [Sun, 19 Dec 2010 02:09:09 +0000 (03:09 +0100)]
libipset: remove redundant casts

13 years agolibipset: remove redundant indirection via union name
Jan Engelhardt [Sun, 19 Dec 2010 02:13:06 +0000 (03:13 +0100)]
libipset: remove redundant indirection via union name

There are no uses of C99 static initializers, so let's make the union
anonymous and reduce accessor lengths.

13 years agolibipset: ipset_strncpy is really a strlcpy-type operation
Jan Engelhardt [Sun, 19 Dec 2010 02:09:56 +0000 (03:09 +0100)]
libipset: ipset_strncpy is really a strlcpy-type operation

13 years agokernel: use EXPORT_SYMBOL_GPL
Jan Engelhardt [Sun, 19 Dec 2010 01:45:54 +0000 (02:45 +0100)]
kernel: use EXPORT_SYMBOL_GPL

13 years agokernel: const annotations
Jan Engelhardt [Sun, 19 Dec 2010 01:44:14 +0000 (02:44 +0100)]
kernel: const annotations

13 years agokernel: use __read_mostly for registration-type structures
Jan Engelhardt [Sun, 19 Dec 2010 01:48:32 +0000 (02:48 +0100)]
kernel: use __read_mostly for registration-type structures

Here is where __read_mostly goes :-)

13 years agokernel: do not mix const and __read_mostly
Jan Engelhardt [Sun, 19 Dec 2010 01:09:19 +0000 (02:09 +0100)]
kernel: do not mix const and __read_mostly

It makes no sense to mix these two. Either it is
writable-plus-read-mostly, or it is constant.

13 years agoxt_set: avoid user types in exported kernel headers
Jan Engelhardt [Sun, 19 Dec 2010 01:27:53 +0000 (02:27 +0100)]
xt_set: avoid user types in exported kernel headers

Within isolated code it would be ok, but not so in exported headers.

13 years agobuild: enable parallel building
Jan Engelhardt [Sun, 19 Dec 2010 01:39:32 +0000 (02:39 +0100)]
build: enable parallel building

$ make modules -j8
cd kernel; make -C /lib/modules/`uname -r`/build M=`pwd` V=0 \
                        IP_SET_MAX=256 \
                        NETLINK_DUMP_CONST=const \
                        NFNL_CB_CONST=const modules
make[1]: Entering directory "/usr/src/linux-2.6.36-rc8-34-obj/x86_64/default"
make[1]: warning: jobserver unavailable: using -j1.
Add '+' to parent make rule.

The "fix" here is that we have to use ${MAKE} instead of make.
(NB: The extra cd is redundant and can be appended to M=.)

13 years agoPrevent calling Makefile directly in the kernel/ subdirectory
Jozsef Kadlecsik [Sat, 18 Dec 2010 23:56:03 +0000 (00:56 +0100)]
Prevent calling Makefile directly in the kernel/ subdirectory

13 years agoPut back the Sparc specific workaround at getaddrinfo.
Jozsef Kadlecsik [Sat, 18 Dec 2010 23:42:03 +0000 (00:42 +0100)]
Put back the Sparc specific workaround at getaddrinfo.

13 years agoShould have gone to sleep: fix check_allowed. Really.
Jozsef Kadlecsik [Sat, 18 Dec 2010 23:38:32 +0000 (00:38 +0100)]
Should have gone to sleep: fix check_allowed. Really.

It's not as nice as I'd like to be: IPSET_CREATE_FLAGS and
IPSET_ADT_FLAGS are required elsewhere, but to make life
simpler, some flags (like IPSET_OPT_TYPENAME) are *not*
added to the types full[] flags. So those must be excluded here.

13 years agoCheck old system kernel header files
Jozsef Kadlecsik [Sat, 18 Dec 2010 22:32:30 +0000 (23:32 +0100)]
Check old system kernel header files

13 years agoCheck from `configure` that the kernel source is patched with netlink.patch
Jozsef Kadlecsik [Sat, 18 Dec 2010 22:02:48 +0000 (23:02 +0100)]
Check from `configure` that the kernel source is patched with netlink.patch

13 years agoUse configure to detect compiler warning flags
Jozsef Kadlecsik [Sat, 18 Dec 2010 21:54:49 +0000 (22:54 +0100)]
Use configure to detect compiler warning flags

By checking the supported compiler warning flags, different gcc releases
are supported without the crude --disable-extra-flags option.

13 years agoThe fix of incorrect comparison in check_allowed completed.
Jozsef Kadlecsik [Sat, 18 Dec 2010 11:34:16 +0000 (12:34 +0100)]
The fix of incorrect comparison in check_allowed completed.

There was still some other incorrect usage of 'enum ipset_cmd' and
'enum ipset_adt' - corrected.