summaryrefslogtreecommitdiffstats
path: root/filter/ulogd_filter_IP2HBIN.c
Commit message (Collapse)AuthorAgeFilesLines
* ip2hbin: store ipv6 address as integerJeremy Sowden2023-09-141-5/+4
| | | | | | | | By using `okey_set_u128` we keep track of the address size and downstream plug-ins can distinguish the address family. Signed-off-by: Jeremy Sowden <jeremy@azazel.net> Signed-off-by: Florian Westphal <fw@strlen.de>
* filter: fix buffer sizes in filter plug-insJeremy Sowden2022-12-081-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Three of the filter plug-ins define arrays to hold output key values. The arrays are sized based on the values of enums. For example: enum output_keys { KEY_MAC_TYPE, KEY_MAC_PROTOCOL, KEY_MAC_SADDR, START_KEY = KEY_MAC_SADDR, KEY_MAC_DADDR, KEY_MAC_ADDR, MAX_KEY = KEY_MAC_ADDR, }; static char hwmac_str[MAX_KEY - START_KEY][HWADDR_LENGTH]; The arrays are indexed by subtracting `START_KEY` from the enum value of the key currently being processed: `hwmac_str[okey - START_KEY]`. However, this means that the last key (`KEY_MAC_ADDR` in this example) will run off the end of the array. Increase the size of the arrays. In the case of `IP2BIN` and `IP2HBIN`, there is no overrun, but only because they use the wrong upper bound when looping over the keys, and thus don't assign a value to the last key. Correct the bound. Also some small white-space tweaks. Link: https://bugzilla.netfilter.org/show_bug.cgi?id=890 Signed-off-by: Jeremy Sowden <jeremy@azazel.net> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
* Use stdint types everywhereFelix Janda2015-06-261-2/+2
| | | | Signed-off-by: Felix Janda <felix.janda@posteo.de>
* filter: IP2HBIN: fix compilation warning with gcc-4.7Pablo Neira Ayuso2012-08-031-1/+0
| | | | | | | ulogd_filter_IP2HBIN.c: In function 'interp_ip2hbin': ulogd_filter_IP2HBIN.c:122:6: warning: unused variable 'fret' [-Wunused-variable] Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
* src: fix version that -V displaysPablo Neira Ayuso2012-08-031-1/+1
| | | | | | | It was wrong, use VERSION constant which uses the version information available in configure.ac. Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
* A simple filter plugin called IP2HBIN addedJozsef Kadlecsik2012-01-161-0/+199
The plugin converts the IPv4 addresses to host order for databases like MySQL. The expected name of the table fields are ip.hsaddr, ip.hdaddr, etc. Signed-off-by: Jozsef Kadlecsik <kadlec@blackhole.kfki.hu>