From 9e4c8217d3f2c7490eb6a26a49e67aeac96ca7c2 Mon Sep 17 00:00:00 2001 From: Natanael Copa Date: Tue, 6 Sep 2011 10:30:10 +0200 Subject: 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. --- pingu_netlink.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'pingu_netlink.c') 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); } -- cgit v1.2.3