The context(although not important), in a netfilter module, we use struct like:
struct data {
char mac[ETH_ALEN];
char in6_addr addr;
};
to keep track of MAC address and ipv6 address.
for handling ipv6 address changes:
- should I compare the new and old value(memcmp), if different, then update(memcpy).
- or, I just update it.
both are valid behavior, so performance is the main concern here.
I found one similar question: https://jira.mongodb.org/browse/SERVER-66
It seems they choose the "just update" way.