summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2012-03-06 02:42:22 +0100
committerMatthias Schiffer <mschiffer@universe-factory.net>2012-03-06 02:42:22 +0100
commitd4686dd79799c09faee49e1645f9b3c39ce1e993 (patch)
treea2071a9e6add624cc090a41e1b82178615e2cebd
parent7adeae186cdf0e986d7b965e5fc000687040ae9f (diff)
downloadfastd-d4686dd79799c09faee49e1645f9b3c39ce1e993.tar
fastd-d4686dd79799c09faee49e1645f9b3c39ce1e993.zip
Simplify fastd_peer_config_is_floating
-rw-r--r--src/peer.h15
1 files changed, 1 insertions, 14 deletions
diff --git a/src/peer.h b/src/peer.h
index 38f13b2..46cdca9 100644
--- a/src/peer.h
+++ b/src/peer.h
@@ -41,20 +41,7 @@ void fastd_peer_delete(fastd_context *ctx, fastd_peer *peer);
static inline bool fastd_peer_config_is_floating(const fastd_peer_config *config) {
- switch (config->address.sa.sa_family) {
- case AF_UNSPEC:
- return true;
-
- case AF_INET:
- return !config->address.in.sin_addr.s_addr;
-
- case AF_INET6:
- return IN6_IS_ADDR_UNSPECIFIED(&config->address.in6.sin6_addr);
-
- default:
- /* What is this? I don't even... */
- return false;
- }
+ return (config->address.sa.sa_family == AF_UNSPEC);
}
static inline bool fastd_peer_is_floating(fastd_peer *peer) {