summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorEric W. Biederman <ebiederm@xmission.com>2015-03-02 00:05:28 -0600
committerDavid S. Miller <davem@davemloft.net>2015-03-02 16:43:40 -0500
commit3b6a94bed0029a6b48055d89b8dea0567abca0ac (patch)
tree97ba52a0d8d6ae197f9a76c4c34c8a760719cf0b /net
parent46d4e47abee04c24055114d50e408078a09c4d36 (diff)
downloadlinux-3b6a94bed0029a6b48055d89b8dea0567abca0ac.tar.bz2
ax25: Refactor to use private neighbour operations.
AX25 already has it's own private arp cache operations to isolate it's abuse of dev_rebuild_header to transmit packets. Add a function ax25_neigh_construct that will allow all of the ax25 devices to force using these operations, so that the generic arp code does not need to. Cc: Ralf Baechle <ralf@linux-mips.org> Cc: linux-hams@vger.kernel.org Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r--net/ax25/ax25_ip.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/net/ax25/ax25_ip.c b/net/ax25/ax25_ip.c
index d93103ba8cec..bff12e0c9090 100644
--- a/net/ax25/ax25_ip.c
+++ b/net/ax25/ax25_ip.c
@@ -216,6 +216,22 @@ put:
return 1;
}
+int ax25_neigh_construct(struct neighbour *neigh)
+{
+ /* This trouble could be saved if ax25 would right a proper
+ * dev_queue_xmit function.
+ */
+ struct ax25_neigh_priv *priv = neighbour_priv(neigh);
+
+ if (neigh->tbl->family != AF_INET)
+ return -EINVAL;
+
+ priv->ops = *neigh->ops;
+ priv->ops.output = neigh_compat_output;
+ priv->ops.connected_output = neigh_compat_output;
+ return 0;
+}
+
#else /* INET */
static int ax25_hard_header(struct sk_buff *skb, struct net_device *dev,
@@ -230,6 +246,10 @@ static int ax25_rebuild_header(struct sk_buff *skb)
return 1;
}
+int ax25_neigh_construct(struct neighbour *neigh)
+{
+ return 0;
+}
#endif
const struct header_ops ax25_header_ops = {
@@ -238,4 +258,5 @@ const struct header_ops ax25_header_ops = {
};
EXPORT_SYMBOL(ax25_header_ops);
+EXPORT_SYMBOL(ax25_neigh_construct);