Netdev List
 help / color / mirror / Atom feed
* [PATCH] arp: Remove the arp_hh_ops structure
@ 2021-02-20  4:32 Yejune Deng
  2021-02-21  1:54 ` David Ahern
  2021-02-21 15:04 ` [arp] 4591591ab7: RIP:neigh_probe kernel test robot
  0 siblings, 2 replies; 4+ messages in thread
From: Yejune Deng @ 2021-02-20  4:32 UTC (permalink / raw)
  To: davem, yoshfuji, dsahern, kuba; +Cc: netdev, linux-kernel, yejune.deng

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 <yejune.deng@gmail.com>
---
 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


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-02-21 14:49 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-02-20  4:32 [PATCH] arp: Remove the arp_hh_ops structure Yejune Deng
2021-02-21  1:54 ` David Ahern
2021-02-21  2:20   ` Yejune Deng
2021-02-21 15:04 ` [arp] 4591591ab7: RIP:neigh_probe kernel test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox