summaryrefslogtreecommitdiff
path: root/forwards.c
Commit message (Collapse)AuthorAgeFilesLines
* Reword rule commentsJo-Philipp Wich2018-03-131-1/+1
| | | | | | | Reword various rule comments to be more explicit and also annotate the flow offloading rule while we're at it. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
* firewall3: add UBUS support for forwarding sectionsPierre Lebleu2017-05-091-39/+80
| | | | | | | It gives the ability to create forward rules via procd services and netifd interface firewall data. Signed-off-by: Pierre Lebleu <pme.lebleu@gmail.com>
* firewall3: check the return value of fw3_parse_options()Pierre Lebleu2017-05-091-1/+2
| | | | | | The return value of fw3_parse_options() should be checked. Signed-off-by: Pierre Lebleu <pme.lebleu@gmail.com>
* global: remove automatic notrack rulesJo-Philipp Wich2016-11-291-22/+6
| | | | | | | | | | | With recent Kernel versions and the introduction of the conntrack routing cache there is no need to maintain performance hacks in userspace anymore, so simply drop the generation of automatic -j CT --notrack rules for zones. This also fixes some cases where traffic is not matched for zones that do not explicitely enforce connection tracking. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
* forwards: properly propagate conntrack flagJo-Philipp Wich2016-11-071-11/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In the following topology: config zone option name A config zone option name B config zone option name C option conntrack 1 config forwarding option src A option dest B config forwarding option src A option dest C ... the conntrack flag needs to be propagated into both zones A and B as well. Since A is connected with C, A will inherit C's conntrack requirement which means that B will need to inherit the flag as well since it is connected to A. The current code fails to apply the conntrack requirement flag recursively to zones, leading to stray NOTRACK rules which break conntrack based traffic policing. Change the implementation to iteratively reapply the conntrack fixup logic until no more zones had been changed in order to ensure that all directly and indirectly connected zones receive the conntrack requirement flag. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
* utils.h: Avoid name clashes for setbit/delbit/hasbitFlorian Fainelli2016-09-181-2/+2
| | | | | | | | | Rename to fw3_{set,del,has}bit to avoid name clashes with sys/param.h: /opt/toolchains/stbgcc-4.8-1.5/arm-linux-gnueabihf/sys-root/usr/include/sys/param.h:80:0: note: this is the location of the previous definition #define setbit(a,i) ((a)[(i)/NBBY] |= 1<<((i)%NBBY)) Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
* treewide: replace jow@openwrt.org with jo@mein.ioJo-Philipp Wich2016-06-071-1/+1
| | | | Signed-off-by: Jo-Philipp Wich <jo@mein.io>
* Use xt_id match to track own rulesJo-Philipp Wich2016-01-241-1/+1
| | | | | | | | | | | Instead of relying on the delegate_* chains to isolate own toplevel rules from user supplied ones, use the xt_id match to attach a magic value to fw3 rules which allows selective cleanup regardless of the container chain. Also add an experimental "fw3 gc" call to garbage collect empty chains. Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
* use calloc instead of malloc+memsetFelix Fietkau2014-06-301-4/+1
| | | | Signed-off-by: Felix Fietkau <nbd@openwrt.org>
* Drop iptables-restore and create rules through libiptc and libxtablesJo-Philipp Wich2013-05-171-18/+18
|
* Remove unused "running" argument form fw3_lookup_zone()Jo-Philipp Wich2013-04-301-2/+2
|
* Consolidate and unify argument order for functionsJo-Philipp Wich2013-03-141-5/+5
|
* Unify fw3_default and fw3_target enumsJo-Philipp Wich2013-03-131-2/+2
|
* Rework zone flush logicJo-Philipp Wich2013-03-111-1/+3
|
* Remove src_flags and running_src_flags from fw3_zone struct, rename ↵Jo-Philipp Wich2013-03-101-1/+1
| | | | dst_flags and running_dst_flags to flags and running_flags
* introduce support for enabled option in zones, forwards, rules, redirects, ↵Jo-Philipp Wich2013-03-021-0/+10
| | | | ipsets and includes
* cosmetic change in printing of forward rulesJo-Philipp Wich2013-02-271-4/+1
|
* unify object freeingJo-Philipp Wich2013-02-211-2/+4
|
* rework runtime state trackingJo-Philipp Wich2013-02-211-2/+2
|
* print a notification if forwards are skipped due to zone family mismatchJo-Philipp Wich2013-02-201-3/+8
|
* rename flag fields in structuresJo-Philipp Wich2013-02-191-1/+1
|
* properly deal with only v4 or only v6 start/stop/restartJo-Philipp Wich2013-02-191-1/+1
|
* selectively delete chains in filter and nat tablesJo-Philipp Wich2013-02-181-1/+1
|
* initial commitJo-Philipp Wich2013-02-171-0/+146