summaryrefslogtreecommitdiffstats
path: root/src/extra/checksum.c
Commit message (Collapse)AuthorAgeFilesLines
* src: checksum.c: remove redundant 0xFFFF mask of uint16_tDuncan Roe2020-01-031-2/+2
| | | | | Signed-off-by: Duncan Roe <duncan_roe@optusnet.com.au> Signed-off-by: Florian Westphal <fw@strlen.de>
* src: more IPv6 checksum fixesDuncan Roe2019-12-301-5/+5
| | | | | | | | | | | - Fix calculation of header length - Upgrade calculation of payload length: Allow for extra headers before the UDP header. - Delete "sum += ... s6_addr16[i] >> 16" lines, since uint16_t >> 16 == 0 - Use upgraded payload length in pseudo-header Signed-off-by: Duncan Roe <duncan_roe@optusnet.com.au> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
* checksum: Fix TCP/UDP checksum computation on big endian archesAlin Nastac2019-10-091-2/+8
| | | | | | | | On big endian arches UDP/TCP checksum is incorrectly computed when payload length is odd. Signed-off-by: Alin Nastac <alin.nastac@gmail.com> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
* checksum: Fix UDP checksum calculationPablo Neira Ayuso2019-09-301-4/+5
| | | | | | | | | | The level 4 protocol is part of the UDP and TCP calculations. nfq_checksum_tcpudp_ipv4() was using IPPROTO_TCP in this calculation, which gave the wrong answer for UDP. Based on patch from Alin Nastac, and patch description from Duncan Roe. Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
* src: extra: add prefix nfq_ to internal checksum functionsPablo Neira Ayuso2013-08-131-5/+5
| | | | | | | | These functions are internal and they belong to the libnetfilter_queue scope, so let's add the corresponding nfq_ prefix. Suggested-by: Florian Westphal <fw@strlen.de> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
* add mangle functions for IPv4/TCP and IPv4/UDPPablo Neira Ayuso2012-08-061-0/+1
| | | | Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
* add pkt_buff and protocol helper functionsPablo Neira Ayuso2012-08-061-0/+78
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>