From: Martin Willi Date: Fri, 19 Apr 2013 14:58:06 +0000 (+0200) Subject: kernel-pfroute: remove unused interface address refcounting X-Git-Tag: 5.1.0dr1~153^2~6 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bd520193a486c6192494f70920702477b843d72e;p=thirdparty%2Fstrongswan.git kernel-pfroute: remove unused interface address refcounting --- diff --git a/src/libhydra/plugins/kernel_pfroute/kernel_pfroute_net.c b/src/libhydra/plugins/kernel_pfroute/kernel_pfroute_net.c index 62664023af..b1d3fd88bf 100644 --- a/src/libhydra/plugins/kernel_pfroute/kernel_pfroute_net.c +++ b/src/libhydra/plugins/kernel_pfroute/kernel_pfroute_net.c @@ -55,9 +55,6 @@ struct addr_entry_t { /** virtual IP managed by us */ bool virtual; - - /** Number of times this IP is used, if virtual */ - u_int refcount; }; /** @@ -430,10 +427,6 @@ static void process_addr(private_kernel_pfroute_net_t *this, addr_map_entry_remove(addr, iface, this); addr_entry_destroy(addr); } - else if (ifa->ifam_type == RTM_NEWADDR && addr->virtual) - { - addr->refcount = 1; - } } } addrs->destroy(addrs); @@ -442,7 +435,6 @@ static void process_addr(private_kernel_pfroute_net_t *this, { INIT(addr, .ip = host->clone(host), - .refcount = 1, ); changed = TRUE; iface->addrs->insert_last(iface->addrs, addr); @@ -497,7 +489,6 @@ static void repopulate_iface(private_kernel_pfroute_net_t *this, case AF_INET6: INIT(addr, .ip = host_create_from_sockaddr(ifa->ifa_addr), - .refcount = 1, ); iface->addrs->insert_last(iface->addrs, addr); addr_map_entry_add(this, addr, iface); @@ -875,7 +866,6 @@ METHOD(kernel_net_t, add_ip, status_t, if (addr->ip->ip_equals(addr->ip, vip)) { addr->virtual = TRUE; - addr->refcount = 1; } } addrs->destroy(addrs); @@ -1222,7 +1212,6 @@ static status_t init_address_list(private_kernel_pfroute_net_t *this) { INIT(addr, .ip = host_create_from_sockaddr(ifa->ifa_addr), - .refcount = 1, ); iface->addrs->insert_last(iface->addrs, addr); addr_map_entry_add(this, addr, iface);