Merge pull request #16532 from yuwata/network-sync-state-file
network: sync link state file on dbus call, and ndisc cleanups
This commit is contained in:
@@ -108,11 +108,7 @@ int in_addr_equal(int family, const union in_addr_union *a, const union in_addr_
|
||||
return in4_addr_equal(&a->in, &b->in);
|
||||
|
||||
if (family == AF_INET6)
|
||||
return
|
||||
a->in6.s6_addr32[0] == b->in6.s6_addr32[0] &&
|
||||
a->in6.s6_addr32[1] == b->in6.s6_addr32[1] &&
|
||||
a->in6.s6_addr32[2] == b->in6.s6_addr32[2] &&
|
||||
a->in6.s6_addr32[3] == b->in6.s6_addr32[3];
|
||||
return IN6_ARE_ADDR_EQUAL(&a->in6, &b->in6);
|
||||
|
||||
return -EAFNOSUPPORT;
|
||||
}
|
||||
|
||||
@@ -151,12 +151,6 @@ void siphash24_compress(const void *_in, size_t inlen, struct siphash *state) {
|
||||
}
|
||||
}
|
||||
|
||||
void siphash24_compress_boolean(bool in, struct siphash *state) {
|
||||
int i = in;
|
||||
|
||||
siphash24_compress(&i, sizeof i, state);
|
||||
}
|
||||
|
||||
uint64_t siphash24_finalize(struct siphash *state) {
|
||||
uint64_t b;
|
||||
|
||||
|
||||
+13
-1
@@ -17,9 +17,21 @@ struct siphash {
|
||||
|
||||
void siphash24_init(struct siphash *state, const uint8_t k[static 16]);
|
||||
void siphash24_compress(const void *in, size_t inlen, struct siphash *state);
|
||||
void siphash24_compress_boolean(bool in, struct siphash *state);
|
||||
#define siphash24_compress_byte(byte, state) siphash24_compress((const uint8_t[]) { (byte) }, 1, (state))
|
||||
|
||||
static inline void siphash24_compress_boolean(bool in, struct siphash *state) {
|
||||
uint8_t i = in;
|
||||
|
||||
siphash24_compress(&i, sizeof i, state);
|
||||
}
|
||||
|
||||
static inline void siphash24_compress_string(const char *in, struct siphash *state) {
|
||||
if (!in)
|
||||
return;
|
||||
|
||||
siphash24_compress(in, strlen(in), state);
|
||||
}
|
||||
|
||||
uint64_t siphash24_finalize(struct siphash *state);
|
||||
|
||||
uint64_t siphash24(const void *in, size_t inlen, const uint8_t k[static 16]);
|
||||
|
||||
Reference in New Issue
Block a user