summaryrefslogtreecommitdiff
path: root/csum.h
diff options
context:
space:
mode:
authorTobias Klauser <tklauser@distanz.ch>2018-03-06 18:44:11 +0100
committerTobias Klauser <tklauser@distanz.ch>2018-03-06 18:44:11 +0100
commit2af099cae27fef1a57aa25d48fc915d619ea216d (patch)
treeff661aad6ab62c6db94b68a3eacba930ffb87881 /csum.h
parent18f5d4dde7ef18efa0489f2007f5ebeed89975ea (diff)
all: drop fmem{cpy,set}
There is no need to explicity use the builtins. According to [1], GCC will recognize mem{cpy,set} as built-in functions, unless the corresponding -fno-builtin-* option is specified (which is not the case for netsniff-ng). [1] https://gcc.gnu.org/onlinedocs/gcc/Other-Builtins.html Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Diffstat (limited to 'csum.h')
-rw-r--r--csum.h8
1 files changed, 5 insertions, 3 deletions
diff --git a/csum.h b/csum.h
index 96211c5..0470dcb 100644
--- a/csum.h
+++ b/csum.h
@@ -1,6 +1,8 @@
#ifndef CSUM_H
#define CSUM_H
+#include <string.h>
+
#include <netinet/in.h>
#include <netinet/ip.h>
#include <netinet/ip6.h>
@@ -182,10 +184,10 @@ static inline uint16_t p6_csum(const struct ip6_hdr *ip6, const uint8_t *data,
uint8_t proto;
} __packed ph;
- fmemcpy(&ph.src, ip6->ip6_src.s6_addr, sizeof(ph.src));
- fmemcpy(&ph.dst, ip6->ip6_dst.s6_addr, sizeof(ph.dst));
+ memcpy(&ph.src, ip6->ip6_src.s6_addr, sizeof(ph.src));
+ memcpy(&ph.dst, ip6->ip6_dst.s6_addr, sizeof(ph.dst));
ph.len = htons(len);
- fmemset(&ph.mbz, 0, sizeof(ph.mbz));
+ memset(&ph.mbz, 0, sizeof(ph.mbz));
ph.proto = next_proto;
vec[0].ptr = (const uint8_t *) (void *) &ph;