diff options
author | Felix Fietkau <nbd@openwrt.org> | 2012-03-15 11:03:52 +0100 |
---|---|---|
committer | Felix Fietkau <nbd@openwrt.org> | 2012-03-15 11:10:36 +0100 |
commit | a63479ad899e089ffd8edf76b35391313b98bc17 (patch) | |
tree | c93777ef5637d69a8baafa4441d0d2b744704fab | |
parent | ad4f8bf0149a88f900c6721c08476730adaf5d58 (diff) |
always create device routes
-rw-r--r-- | interface-ip.c | 2 | ||||
-rw-r--r-- | interface-ip.h | 3 | ||||
-rw-r--r-- | proto.c | 2 | ||||
-rw-r--r-- | system-dummy.c | 6 | ||||
-rw-r--r-- | system-linux.c | 3 |
5 files changed, 4 insertions, 12 deletions
diff --git a/interface-ip.c b/interface-ip.c index 51612fa..3204cd9 100644 --- a/interface-ip.c +++ b/interface-ip.c @@ -83,8 +83,6 @@ interface_ip_add_route(struct interface *iface, struct blob_attr *attr, bool v6) DPRINTF("Failed to parse route gateway: %s\n", (char *) blobmsg_data(cur)); goto error; } - } else { - route->flags |= DEVADDR_DEVICE; } if ((cur = tb[ROUTE_METRIC]) != NULL) diff --git a/interface-ip.h b/interface-ip.h index e983a84..0ce94df 100644 --- a/interface-ip.h +++ b/interface-ip.h @@ -9,9 +9,6 @@ enum device_addr_flags { DEVADDR_INET6 = (1 << 0), DEVADDR_FAMILY = DEVADDR_INET4 | DEVADDR_INET6, - /* device route (no gateway) */ - DEVADDR_DEVICE = (1 << 1), - /* externally added address */ DEVADDR_EXTERNAL = (1 << 2), }; @@ -183,7 +183,7 @@ parse_gateway_option(struct interface *iface, struct blob_attr *attr, bool v6) } route->mask = 0; - route->flags = DEVADDR_DEVICE | (v6 ? DEVADDR_INET6 : DEVADDR_INET4); + route->flags = (v6 ? DEVADDR_INET6 : DEVADDR_INET4); vlist_add(&iface->proto_ip.route, &route->node, &route->mask); return true; diff --git a/system-dummy.c b/system-dummy.c index 401a1a9..b3aefbe 100644 --- a/system-dummy.c +++ b/system-dummy.c @@ -156,8 +156,7 @@ int system_add_route(struct device *dev, struct device_route *route) sprintf(gw, " gw %d.%d.%d.%d", a2[0], a2[1], a2[2], a2[3]); - if (route->flags & DEVADDR_DEVICE) - sprintf(devstr, " dev %s", dev->ifname); + sprintf(devstr, " dev %s", dev->ifname); if (route->metric > 0) sprintf(devstr, " metric %d", route->metric); @@ -185,8 +184,7 @@ int system_del_route(struct device *dev, struct device_route *route) sprintf(gw, " gw %d.%d.%d.%d", a2[0], a2[1], a2[2], a2[3]); - if (route->flags & DEVADDR_DEVICE) - sprintf(devstr, " dev %s", dev->ifname); + sprintf(devstr, " dev %s", dev->ifname); D(SYSTEM, "route del %s%s%s\n", addr, gw, devstr); return 0; diff --git a/system-linux.c b/system-linux.c index 0e6ce5a..66799e9 100644 --- a/system-linux.c +++ b/system-linux.c @@ -901,8 +901,7 @@ static int system_rt(struct device *dev, struct device_route *route, int cmd) if (have_gw) nla_put(msg, RTA_GATEWAY, alen, &route->nexthop); - if (route->flags & DEVADDR_DEVICE) - nla_put_u32(msg, RTA_OIF, ifindex); + nla_put_u32(msg, RTA_OIF, ifindex); return system_rtnl_call(msg); } |