diff options
author | Felix Fietkau <nbd@openwrt.org> | 2012-09-06 12:57:20 +0200 |
---|---|---|
committer | Felix Fietkau <nbd@openwrt.org> | 2012-09-06 16:54:38 +0200 |
commit | c58e7f45ec4e32db109ffb12d22745133a3b1068 (patch) | |
tree | 155990c7b8804e8996b9b18abff46fd49f019bc5 /system.h | |
parent | 9411d498c46fe3f1c4d79eb8fa0b7c97dd32a990 (diff) |
clean up and fix system-dummy addr/route messages
Diffstat (limited to 'system.h')
-rw-r--r-- | system.h | 17 |
1 files changed, 17 insertions, 0 deletions
@@ -16,6 +16,7 @@ #include <sys/time.h> #include <sys/socket.h> +#include <arpa/inet.h> #include "device.h" #include "interface-ip.h" @@ -49,6 +50,22 @@ struct bridge_config { int max_age; }; +static inline int system_get_addr_family(unsigned int flags) +{ + if ((flags & DEVADDR_FAMILY) == DEVADDR_INET6) + return AF_INET6; + else + return AF_INET; +} + +static inline int system_get_addr_len(unsigned int flags) +{ + if ((flags & DEVADDR_FAMILY) == DEVADDR_INET6) + return sizeof(struct in_addr); + else + return sizeof(struct in6_addr); +} + int system_init(void); int system_bridge_addbr(struct device *bridge, struct bridge_config *cfg); |