From 4e398dccc093119e9a19c7eff56eab28d9204b37 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Wed, 25 Nov 2020 17:37:41 +0100 Subject: [PATCH] Revert "Exempt multicast addresses from five-second neighbor lifetime" This reverts commit e5fe052c065d8074106bc8b68aed88deffe9c5cf as it breaks some ABIs that people are relying on. The need for this in an android device seems low at this point in time. If it is deemed that this is needed, this patch can be revisited and added back in a different way to not touch the abi. Bug: 161946584 Signed-off-by: Greg Kroah-Hartman Change-Id: I019a290c6d7d54d50a143a93063bcd88d80d6c98 --- include/net/neighbour.h | 1 - net/core/neighbour.c | 2 -- net/ipv4/arp.c | 6 ------ net/ipv6/ndisc.c | 7 ------- 4 files changed, 16 deletions(-) diff --git a/include/net/neighbour.h b/include/net/neighbour.h index 2be8d6b0dfb6..8ec77bfdc1a4 100644 --- a/include/net/neighbour.h +++ b/include/net/neighbour.h @@ -204,7 +204,6 @@ struct neigh_table { int (*pconstructor)(struct pneigh_entry *); void (*pdestructor)(struct pneigh_entry *); void (*proxy_redo)(struct sk_buff *skb); - int (*is_multicast)(const void *pkey); bool (*allow_add)(const struct net_device *dev, struct netlink_ext_ack *extack); char *id; diff --git a/net/core/neighbour.c b/net/core/neighbour.c index 6c270fce200f..04953e5f2530 100644 --- a/net/core/neighbour.c +++ b/net/core/neighbour.c @@ -235,8 +235,6 @@ static int neigh_forced_gc(struct neigh_table *tbl) write_lock(&n->lock); if ((n->nud_state == NUD_FAILED) || - (tbl->is_multicast && - tbl->is_multicast(n->primary_key)) || time_after(tref, n->updated)) remove = true; write_unlock(&n->lock); diff --git a/net/ipv4/arp.c b/net/ipv4/arp.c index 7b951992c372..05eb42f347e8 100644 --- a/net/ipv4/arp.c +++ b/net/ipv4/arp.c @@ -125,7 +125,6 @@ static int arp_constructor(struct neighbour *neigh); static void arp_solicit(struct neighbour *neigh, struct sk_buff *skb); static void arp_error_report(struct neighbour *neigh, struct sk_buff *skb); static void parp_redo(struct sk_buff *skb); -static int arp_is_multicast(const void *pkey); static const struct neigh_ops arp_generic_ops = { .family = AF_INET, @@ -157,7 +156,6 @@ struct neigh_table arp_tbl = { .key_eq = arp_key_eq, .constructor = arp_constructor, .proxy_redo = parp_redo, - .is_multicast = arp_is_multicast, .id = "arp_cache", .parms = { .tbl = &arp_tbl, @@ -930,10 +928,6 @@ static void parp_redo(struct sk_buff *skb) arp_process(dev_net(skb->dev), NULL, skb); } -static int arp_is_multicast(const void *pkey) -{ - return ipv4_is_multicast(*((__be32 *)pkey)); -} /* * Receive an arp request from the device layer. diff --git a/net/ipv6/ndisc.c b/net/ipv6/ndisc.c index 455ef8498439..945ef37eab9d 100644 --- a/net/ipv6/ndisc.c +++ b/net/ipv6/ndisc.c @@ -81,7 +81,6 @@ static void ndisc_error_report(struct neighbour *neigh, struct sk_buff *skb); static int pndisc_constructor(struct pneigh_entry *n); static void pndisc_destructor(struct pneigh_entry *n); static void pndisc_redo(struct sk_buff *skb); -static int ndisc_is_multicast(const void *pkey); static const struct neigh_ops ndisc_generic_ops = { .family = AF_INET6, @@ -116,7 +115,6 @@ struct neigh_table nd_tbl = { .pconstructor = pndisc_constructor, .pdestructor = pndisc_destructor, .proxy_redo = pndisc_redo, - .is_multicast = ndisc_is_multicast, .allow_add = ndisc_allow_add, .id = "ndisc_cache", .parms = { @@ -1708,11 +1706,6 @@ static void pndisc_redo(struct sk_buff *skb) kfree_skb(skb); } -static int ndisc_is_multicast(const void *pkey) -{ - return ipv6_addr_is_multicast((struct in6_addr *)pkey); -} - static bool ndisc_suppress_frag_ndisc(struct sk_buff *skb) { struct inet6_dev *idev = __in6_dev_get(skb->dev);