Skip to content
This repository has been archived by the owner on Apr 18, 2024. It is now read-only.

Commit

Permalink
mptcp: Remove IPv6 duplicated address detection
Browse files Browse the repository at this point in the history
It causes us to take a refcnt on the address and actually periodically
schedule a timer until eventually the address gets either marked as
confirmed or removed.

It causes regressions in the Android test-suite.

This patch simply removes the duplicate address detection. That way,
when we get an IPv6-address we use it right away. Also, if the address
turns out to be duplicate on the link (which is really a cornercase
scenario), it will be removed and our subflow will be destroyed. I don't
think that's a big deal.

I don't suggest to backport this patch as it's more of a design-change
than a bugfix.

Github-issue: #293

Signed-off-by: Christoph Paasch <[email protected]>
Signed-off-by: Matthieu Baerts <[email protected]>
  • Loading branch information
cpaasch authored and matttbe committed Nov 27, 2018
1 parent 4b72016 commit 8e3743b
Showing 1 changed file with 1 addition and 64 deletions.
65 changes: 1 addition & 64 deletions net/mptcp/mptcp_fullmesh.c
Original file line number Diff line number Diff line change
Expand Up @@ -1122,69 +1122,9 @@ static struct notifier_block mptcp_pm_inetaddr_notifier = {

#if IS_ENABLED(CONFIG_IPV6)

/* IPV6-related address/interface watchers */
struct mptcp_dad_data {
struct timer_list timer;
struct inet6_ifaddr *ifa;
};

static void dad_callback(struct timer_list *t);
static int inet6_addr_event(struct notifier_block *this, unsigned long event,
void *ptr);

static bool ipv6_dad_finished(const struct inet6_ifaddr *ifa)
{
return !(ifa->flags & IFA_F_TENTATIVE) ||
ifa->state > INET6_IFADDR_STATE_DAD;
}

static void dad_init_timer(struct mptcp_dad_data *data,
struct inet6_ifaddr *ifa)
{
data->ifa = ifa;
if (ifa->idev->cnf.rtr_solicit_delay)
data->timer.expires = jiffies + ifa->idev->cnf.rtr_solicit_delay;
else
data->timer.expires = jiffies + (HZ/10);
}

static void dad_callback(struct timer_list *t)
{
struct mptcp_dad_data *data = from_timer(data, t, timer);

/* DAD failed or IP brought down? */
if (data->ifa->state == INET6_IFADDR_STATE_ERRDAD ||
data->ifa->state == INET6_IFADDR_STATE_DEAD)
goto exit;

if (!ipv6_dad_finished(data->ifa)) {
dad_init_timer(data, data->ifa);
add_timer(&data->timer);
return;
}

inet6_addr_event(NULL, NETDEV_UP, data->ifa);

exit:
in6_ifa_put(data->ifa);
kfree(data);
}

static inline void dad_setup_timer(struct inet6_ifaddr *ifa)
{
struct mptcp_dad_data *data;

data = kmalloc(sizeof(*data), GFP_ATOMIC);

if (!data)
return;

timer_setup(&data->timer, dad_callback, 0);
dad_init_timer(data, ifa);
add_timer(&data->timer);
in6_ifa_hold(ifa);
}

static void addr6_event_handler(const struct inet6_ifaddr *ifa, unsigned long event,
struct net *net)
{
Expand Down Expand Up @@ -1233,10 +1173,7 @@ static int inet6_addr_event(struct notifier_block *this, unsigned long event,
event == NETDEV_CHANGE))
return NOTIFY_DONE;

if (!ipv6_dad_finished(ifa6))
dad_setup_timer(ifa6);
else
addr6_event_handler(ifa6, event, net);
addr6_event_handler(ifa6, event, net);

return NOTIFY_DONE;
}
Expand Down

0 comments on commit 8e3743b

Please sign in to comment.