Commit Graph

685 Commits

Author SHA1 Message Date
Jan Engelhardt
1f3150bdf9 pknock: remove trailing whitespace 2009-10-03 01:43:00 +02:00
Jan Engelhardt
13c73af796 pknock: remove unneeded braces 2009-10-03 01:26:31 +02:00
Jan Engelhardt
ba9a3efec1 pknock: use preincrements where possible
Preincrements are much less error-prone and even do not need extra
parentheses.
2009-10-03 01:26:31 +02:00
Jan Engelhardt
f474c7d4d4 pknock: rename IPT_PKNOCK_* -> XT_PKNOCK_* 2009-10-03 01:26:31 +02:00
Jan Engelhardt
4a350ddd03 pknock: move more kernel parts from include file to .c
All of this does not seem to have a userspace part.
2009-10-03 01:26:31 +02:00
Jan Engelhardt
628d137f12 pknock: rename struct ipt_pknock -> xt_pknock_mtinfo
Streamline symbols; use xt_*_mtinfo as other modules do.
2009-10-03 01:26:31 +02:00
Jan Engelhardt
28ecf45548 pknock: redo inline hints
The compiler is usually smart enough to decide this on its own.
Some functions however do not warrant even the hint keyword.
2009-10-03 01:26:31 +02:00
Jan Engelhardt
58839b9b86 pknock: use bools for two-state ints 2009-10-03 01:26:31 +02:00
Jan Engelhardt
e436948ebd pknock: use explicit tests for non-bool types 2009-10-03 01:26:30 +02:00
Jan Engelhardt
79d54ebd7c pknock: split long instructions, esp. allocations in if() 2009-10-03 01:26:28 +02:00
Jan Engelhardt
0b64b27172 build: ignore srcdir layout on install
Kbuild would install the .ko module files relative to their source
directory, i.e.

  extensions/xt_quota.ko
  -> /lib/modules/%/extra/xt_quota.ko
  extensions/ACCOUNT/xt_ACCOUNT.ko
  -> /lib/modules/%/extra/ACCOUNT/xt_ACCOUNT.ko

Add a hack to Makefile.am so that it all goes into extra/ only,
without any further subdirectories created. This is strictly a hack
as it pokes with Kbuild internals.

Putting the ext-mod-dir override into extensions/Kbuild would not do,
it is overridden by $linux/scripts/Makefile.modinst, so a higher
priority override is needed (make command line by means of
Makefile.am invoking make).
2009-10-01 00:08:33 +02:00
Jan Engelhardt
d116000784 pknock: fix return values and memleak in has_secret
First, there is a memory leak - when the crypto functions fail,
hexresult was not freed. Second, in that error case, the return value
is simply passed up to the caller, ignoring the different meanings of
0 and 1 between crypto and pknock.
2009-09-30 01:19:59 +02:00
Jan Engelhardt
4b5f0b12d9 pknock: remove initialization of data where not needed
bss will be set to zero anyway.
For automatic variables, the preinit is not always needed
(gcc will warn about it).
2009-09-30 01:19:58 +02:00
Jan Engelhardt
c8dde526f2 pknock: use unsigned qualifiers where they are due 2009-09-30 01:19:39 +02:00
Jan Engelhardt
3058e42a21 pknock: remove pointless casts 2009-09-30 00:49:30 +02:00
Jan Engelhardt
40b30f7f27 pknock: add const qualifiers 2009-09-30 00:49:29 +02:00
Jan Engelhardt
aaad5f53ac pknock: remove pointless sizeof(char)
sizeof(char) is defined to be 1, anyway.
2009-09-30 00:09:07 +02:00
Jan Engelhardt
db1057158f pknock: return -ENXIO for problems during init
Some functions like the crypto init or proc_mkdir do not return an
error value. Replace the -1, which is actually EPERM, and looks a
little out of place, and use ENXIO instead. (After all, the requested
objects were not there after the request of initialization.)
2009-09-30 00:05:42 +02:00
Jan Rafaj
713c31e8f7 pknock: guard off crypto code from kernels before 2.6.19 2009-09-29 23:47:03 +02:00
Jan Engelhardt
e5ffb39750 pknock: rename DEBUGP to pk_debug and always enable
Since pr_debug depends on #if DEBUG anyway, there is no need to
contain DEBUGP/pk_debug within a further if. Rename from DEBUGP to
pk_debug, because DEBUGP is flagged by Xtables-addons (- and that's
good so, because often DEBUGPs should have been pr_debug instead).
2009-09-29 23:45:29 +02:00
Jan Rafaj
19067393b6 pknock: replace printks by pr_debug
The printk calls were protected using #if DEBUG anyway, so they can
just be changed to pr_debug. pr_debug also depends on #if DEBUG, and
takes care of the module prefix.
2009-09-29 23:45:29 +02:00
Jan Engelhardt
1de82a88a1 pknock: avoid accidental deletion of rules
If DEBUG was not defined, and no rule was effectively found, the
"rule" variable may still be non-NULL, and possibly cause deletion.
Therefore, always check for the rule having been found.
2009-09-29 23:45:29 +02:00
Jan Engelhardt
9928c864ab pknock: drop evil-tinygram warning messages
The duprintf macro then also becomes unneeded.
2009-09-29 23:45:28 +02:00
Jan Engelhardt
45515a0afd pknock: bump internal match revision number
Do this so that previous iptables installations do not mistakenly
operate with our new xt_pknock.
2009-09-29 23:45:28 +02:00
Jan Engelhardt
75f80fa8f8 pknock: move struct ipt_pknock_crypto to xt_pknock.c
It is only used in xt_pknock.c, and only once, so also make it an
anonymous struct.
2009-09-29 23:45:28 +02:00
Jan Engelhardt
d8dc72d151 pknock: only use size-fixated types
Types with variadic size are a no-no.
2009-09-29 23:36:53 +02:00
Jan Engelhardt
cee3d25d49 pknock: improve sizeof(struct ipt_pknock) by relayouting members
Stuffing struct holes as reported by pahole(1).
2009-09-29 19:36:14 +02:00
Jan Engelhardt
afbeb2fb47 pknock: improve sizeof(struct ipt_pknock) by using "even" field sizes
The field sizes were 33, which makes for lots of padding holes.
2009-09-29 19:36:14 +02:00
Jan Rafaj
c0dc0858de pknock: renaming of functions and prefix-name 2009-09-29 19:36:01 +02:00
Jan Rafaj
b04317576b pknock: add MODULE_ALIAS for pknock
Needed for autoloading.
2009-09-29 15:05:05 +02:00
Jan Rafaj
af2bbf0352 pknock: fit to Xtables-addons API 2009-09-29 15:03:45 +02:00
Jan Engelhardt
db9bb2778d pknock: import pknock trunk@463 2009-09-29 14:00:59 +02:00
Jan Engelhardt
674560d2d9 Merge branch 'psd' 2009-09-26 00:19:57 +02:00
Jan Engelhardt
7ab033e64c Update .gitignore files 2009-09-26 00:13:15 +02:00
Jan Engelhardt
3131448443 build: require at least automake 1.10
Automake 1.10 seems to be the first to set abs_srcdir and such.
2009-09-26 00:11:35 +02:00
Jan Engelhardt
71322e614c build: restore parallel build capability
It seems that ${MAKE} must be in the first expansion level.
2009-09-25 21:18:09 +02:00
Jan Engelhardt
d3fdfe08dd Merge branch 'ACCOUNT' 2009-09-25 15:07:46 +02:00
Jan Engelhardt
46f9ddbf59 ACCOUNT: move manpage into ACCOUNT/ directory 2009-09-24 01:52:42 +02:00
Jan Engelhardt
e37985b527 ACCOUNT/userspace: use bool type 2009-09-24 01:48:16 +02:00
Jan Engelhardt
0ccd55abd9 ACCOUNT/userspace: remove pointless casts 2009-09-24 01:46:56 +02:00
Jan Engelhardt
60123a8c07 ACCOUNT/userspace: remove static zero initializers 2009-09-24 01:46:56 +02:00
Jan Engelhardt
504f1089fb ACCOUNT/userspace: simple reformat, use tabs instead of spaces 2009-09-24 01:46:55 +02:00
Jan Engelhardt
e119350000 ACCOUNT/userspace: remove trailing whitespace 2009-09-24 01:35:45 +02:00
Jan Rafaj
a260e3349f ACCOUNT: import userspace utilities 2009-09-24 01:27:11 +02:00
Jan Engelhardt
5cb36ed213 ACCOUNT: move xt_ACCOUNT into its own subdirectory
Will be adding related userspace programs shortly, and an extra
directory for the same reason it is for ipset/.
2009-09-24 01:00:15 +02:00
Jan Engelhardt
1a5b9f0e02 Merge branch 'master' into ACCOUNT 2009-09-24 01:00:10 +02:00
Jan Engelhardt
2c53605084 build: enable automake for extensions/ directory
Because we are likely to be having more userspace programs soon, and
reproducing manual makefiles is a bad idea, make extensions/ ready
for automake traversal. The build pattern now is:

1.  toplevel Makefile.am starts off with extensions/Makefile.am

2.  Makefile.am

    a.  builds programs in current directory

    b.  runs Kbuild
        - only from extensions/Makefile.am
          (so it does not get reinvoked from case 2cII)
        - Kbuild recurses on its own

    c.  runs Mbuild
        I.  builds iptables shared libraries in current directory
        II. runs Makefile.am in each subdir (goto step 2.)
2009-09-24 00:59:59 +02:00
Jan Engelhardt
537f25dbad build: use automake in ipset/ 2009-09-19 20:11:59 +02:00
Jan Rafaj
63a1e5329f ACCOUNT: add Kconfig file 2009-09-18 15:46:39 +02:00
Jan Engelhardt
b0a6111054 build: stable version number detection fix 2009-09-12 02:42:40 +02:00