aboutsummaryrefslogtreecommitdiffstats
path: root/pingu_netlink.c
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2011-09-06 10:30:10 +0200
committerNatanael Copa <ncopa@alpinelinux.org>2011-09-06 10:30:10 +0200
commit9e4c8217d3f2c7490eb6a26a49e67aeac96ca7c2 (patch)
tree25f27e08015dd9ac45cdfea85f578937982f7c16 /pingu_netlink.c
parent91774e47e23c83aa3df901adc167ab4592f87a22 (diff)
downloadpingu-9e4c8217d3f2c7490eb6a26a49e67aeac96ca7c2.tar.bz2
pingu-9e4c8217d3f2c7490eb6a26a49e67aeac96ca7c2.tar.xz
pingu: only create/lose binding when we get/lose address
We don't need to rebind every burst. We only bind when we get an address and we only lose the binding when the address is lost.
Diffstat (limited to 'pingu_netlink.c')
-rw-r--r--pingu_netlink.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/pingu_netlink.c b/pingu_netlink.c
index de5a721..f3ca952 100644
--- a/pingu_netlink.c
+++ b/pingu_netlink.c
@@ -466,7 +466,6 @@ static void netlink_link_new_cb(struct nlmsghdr *msg)
iface->index = ifi->ifi_index;
iface->has_link = 1;
- pingu_iface_bind_socket(iface, 1);
}
static void netlink_link_del_cb(struct nlmsghdr *msg)
@@ -510,6 +509,7 @@ static void netlink_addr_new_cb(struct nlmsghdr *msg)
pingu_iface_set_addr(iface, ifa->ifa_family,
RTA_DATA(rta[IFA_LOCAL]),
RTA_PAYLOAD(rta[IFA_LOCAL]));
+ pingu_iface_bind_socket(iface, 1);
netlink_rule_replace_or_add(&talk_fd, iface);
}