summaryrefslogtreecommitdiff
path: root/system-dummy.c
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2011-05-02 23:00:30 +0200
committerFelix Fietkau <nbd@openwrt.org>2011-05-02 23:00:30 +0200
commit273550337f70b8b2175875e0c4f0bbd483cfe326 (patch)
treeb433b4dcc731d61f750692a2a531c21e5eac4f26 /system-dummy.c
parent85218c601b0f5895f9025910643761930c02eb1a (diff)
downloadnetifd-273550337f70b8b2175875e0c4f0bbd483cfe326.tar.gz
move interface address handling to the device module, clean up arguments to system_{add,del}_addr
Diffstat (limited to 'system-dummy.c')
-rw-r--r--system-dummy.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/system-dummy.c b/system-dummy.c
index 7e009ba..2d391df 100644
--- a/system-dummy.c
+++ b/system-dummy.c
@@ -62,13 +62,13 @@ int system_if_check(struct device *dev)
return 0;
}
-int system_add_address(struct device *dev, int family, void *addr, int prefixlen)
+int system_add_address(struct device *dev, struct device_addr *addr)
{
- uint8_t *a = addr;
+ uint8_t *a = (uint8_t *) &addr->addr.in;
- if (family == AF_INET) {
+ if ((addr->flags & DEVADDR_FAMILY) == DEVADDR_INET4) {
DPRINTF("ifconfig %s add %d.%d.%d.%d/%d\n",
- dev->ifname, a[0], a[1], a[2], a[3], prefixlen);
+ dev->ifname, a[0], a[1], a[2], a[3], addr->mask);
} else {
return -1;
}
@@ -76,11 +76,11 @@ int system_add_address(struct device *dev, int family, void *addr, int prefixlen
return 0;
}
-int system_del_address(struct device *dev, int family, void *addr)
+int system_del_address(struct device *dev, struct device_addr *addr)
{
- uint8_t *a = addr;
+ uint8_t *a = (uint8_t *) &addr->addr.in;
- if (family == AF_INET) {
+ if ((addr->flags & DEVADDR_FAMILY) == DEVADDR_INET4) {
DPRINTF("ifconfig %s del %d.%d.%d.%d\n",
dev->ifname, a[0], a[1], a[2], a[3]);
} else {