Thread (4 messages) flat view 4 messages, 3 authors, 2021-02-21
STALE2010d

[PATCH] arp: Remove the arp_hh_ops structure

From: Yejune Deng <hidden>
Date: 2021-02-20 04:33:14
Also in: lkml
Subsystem: networking [general], networking [ipv4/ipv6], the rest · Maintainers: "David S. Miller", Eric Dumazet, Jakub Kicinski, Paolo Abeni, David Ahern, Ido Schimmel, Linus Torvalds

The 'arp_hh_ops' structure is similar to the 'arp_generic_ops' structure.
So remove the 'arp_hh_ops' structure.

Signed-off-by: Yejune Deng <redacted>
---
 net/ipv4/arp.c | 19 +++----------------
 1 file changed, 3 insertions(+), 16 deletions(-)
diff --git a/net/ipv4/arp.c b/net/ipv4/arp.c
index 922dd73e5740..6d60d9b89286 100644
--- a/net/ipv4/arp.c
+++ b/net/ipv4/arp.c
@@ -135,14 +135,6 @@ static const struct neigh_ops arp_generic_ops = {
 	.connected_output =	neigh_connected_output,
 };
 
-static const struct neigh_ops arp_hh_ops = {
-	.family =		AF_INET,
-	.solicit =		arp_solicit,
-	.error_report =		arp_error_report,
-	.output =		neigh_resolve_output,
-	.connected_output =	neigh_resolve_output,
-};
-
 static const struct neigh_ops arp_direct_ops = {
 	.family =		AF_INET,
 	.output =		neigh_direct_output,
@@ -277,15 +269,10 @@ static int arp_constructor(struct neighbour *neigh)
 			memcpy(neigh->ha, dev->broadcast, dev->addr_len);
 		}
 
-		if (dev->header_ops->cache)
-			neigh->ops = &arp_hh_ops;
-		else
-			neigh->ops = &arp_generic_ops;
-
-		if (neigh->nud_state & NUD_VALID)
-			neigh->output = neigh->ops->connected_output;
+		if (!dev->header_ops->cache && (neigh->nud_state & NUD_VALID))
+			neigh->output = arp_generic_ops.connected_output;
 		else
-			neigh->output = neigh->ops->output;
+			neigh->output = arp_generic_ops.output;
 	}
 	return 0;
 }
-- 
2.29.0
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help