projects
/
oweals
/
netifd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
818abd9
)
free routes and addresses
author
Felix Fietkau
<nbd@openwrt.org>
Mon, 5 Sep 2011 03:53:07 +0000
(
05:53
+0200)
committer
Felix Fietkau
<nbd@openwrt.org>
Mon, 5 Sep 2011 03:53:07 +0000
(
05:53
+0200)
interface-ip.c
patch
|
blob
|
history
interface-ip.h
patch
|
blob
|
history
diff --git
a/interface-ip.c
b/interface-ip.c
index 6decaea7b16861c0adc00cf4316f8f70f8242881..b86acb5856033d240724a80e022f83b1d8e132c7 100644
(file)
--- a/
interface-ip.c
+++ b/
interface-ip.c
@@
-34,6
+34,7
@@
void interface_del_address(struct interface *iface, struct device_addr *addr)
list_del(&addr->list);
system_del_address(iface->l3_iface->dev, addr);
+ free(addr);
}
void interface_del_ctx_addr(struct interface *iface, void *ctx)
@@
-58,6
+59,8
@@
void interface_del_route(struct interface *iface, struct device_route *route)
{
list_del(&route->list);
system_del_route(iface->l3_iface->dev, route);
+ if (!route->keep)
+ free(route);
}
void interface_del_all_routes(struct interface *iface)
diff --git
a/interface-ip.h
b/interface-ip.h
index 2f5cf855665c023270d0914c272bf52083f0df33..e83e32726312d6b09f690841cb6290ce854c4d40 100644
(file)
--- a/
interface-ip.h
+++ b/
interface-ip.h
@@
-31,6
+31,7
@@
struct device_route {
void *ctx;
enum device_addr_flags flags;
+ bool keep;
unsigned int mask;
union if_addr addr;