summaryrefslogtreecommitdiffstats
path: root/src/helpers/ftp.c
Commit message (Collapse)AuthorAgeFilesLines
* conntrackd: cthelper: Don't leak nat_tupleKevin Cernekee2017-02-011-0/+1
| | | | | | | | | | nfexp_set_attr() copies |nat_tuple| rather than taking ownership, so it should be freed at the end of the loop. Some of the other helpers (like rpc.c) do this, but it is missing here. Reported-by: Eric Caruso <ejcaruso@chromium.org> Signed-off-by: Kevin Cernekee <cernekee@chromium.org> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
* conntrackd: cthelper: ftp: Fix debug printKevin Cernekee2016-09-051-1/+1
| | | | | | | | matchoff is relative to dataoff, i.e. matchoff=0 (as utilized by nfq_tcp_mangle_ipv4()) points to the first byte of the TCP payload. Signed-off-by: Kevin Cernekee <cernekee@chromium.org> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
* conntrackd: cthelper: ftp: Set match offset/len for PORT manglingKevin Cernekee2016-09-051-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | Currently matchoff and matchlen are 0, so IP mangling is performed in the wrong place if NAT is used: FTP_NAT: type 0, off 0 len 0 The resultant packet is clearly incorrect: 0x0000: 9410 3eb8 00ab 00e0 4c68 0012 0800 4510 ..>.....Lh....E. 0x0010: 0081 9ed9 4000 4006 cd35 646b 0370 646b ....@.@..5dk.pdk 0x0020: 0212 0015 87c5 8cc2 de50 aa28 4842 8018 .........P.(HB.. 0x0030: 00e3 459d 0000 0101 080a e916 985e 2a3b ..E..........^*; 0x0040: b82d 3530 3020 2731 3030 2c31 3037 2c32 .-500.'100,107,2 0x0050: 2c31 382c 3134 392c 3739 504f 5254 2031 ,18,149,79PORT.1 0x0060: 3932 2c31 3638 2c32 3534 2c32 2c31 3439 92,168,254,2,149 0x0070: 2c37 3927 3a20 636f 6d6d 616e 6420 6e6f ,79':.command.no 0x0080: 7420 756e 6465 7273 746f 6f64 2e0d 0a t.understood... Add the missing assignments. Signed-off-by: Kevin Cernekee <cernekee@chromium.org> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
* src: Define _GNU_SOURCE to get members of tcphdr&ucphdrFelix Janda2015-05-211-0/+1
| | | | | | | | | The source uses linux names for members of tcphdr. For example "source" instead of "th_sport", ... musl libc's headers need _GNU_SOURCE defined in order to expose these. Signed-off-by: Felix Janda <felix.janda@posteo.de> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
* src: Use stdint typesFelix Janda2015-05-211-1/+1
| | | | | Signed-off-by: Felix Janda <felix.janda@posteo.de> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
* cthelper: ftp: fix EPRT case for IPv4Pablo Neira Ayuso2012-08-211-1/+6
| | | | | | | | | %pI4 also exists in the Linux kernel. It would be good to have some generic functions to convert binary data to address string. Later. Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
* conntrackd: add cthelper infrastructure (+ example FTP helper)Pablo Neira Ayuso2012-08-011-0/+599
This patch adds the user-space helper infrastructure. It also contains the implementation of the FTP helper in user-space. There's one example file that you can use to configure conntrackd as user-space connection tracking helper under: doc/helper/conntrackd.conf Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>