From 1d5da757da860a6916adbf68b09e868062b4b3b8 Mon Sep 17 00:00:00 2001 From: "Eric W. Biederman" Date: Tue, 3 Mar 2015 09:41:47 -0600 Subject: ax25: Stop using magic neighbour cache operations. Before the ax25 stack calls dev_queue_xmit it always calls ax25_type_trans which sets skb->protocol to ETH_P_AX25. Which means that by looking at the protocol type it is possible to detect IP packets that have not been munged by the ax25 stack in ndo_start_xmit and call a function to munge them. Rename ax25_neigh_xmit to ax25_ip_xmit and tweak the return type and value to be appropriate for an ndo_start_xmit function. Update all of the ax25 devices to test the protocol type for ETH_P_IP and return ax25_ip_xmit as the first thing they do. This preserves the existing semantics of IP packet processing, but the timing will be a little different as the IP packets now pass through the qdisc layer before reaching the ax25 ip packet processing. Remove the now unnecessary ax25 neighbour table operations. Signed-off-by: "Eric W. Biederman" Signed-off-by: David S. Miller --- drivers/net/hamradio/6pack.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'drivers/net/hamradio/6pack.c') diff --git a/drivers/net/hamradio/6pack.c b/drivers/net/hamradio/6pack.c index 0b8393ca8c80..7c4a4151ef0f 100644 --- a/drivers/net/hamradio/6pack.c +++ b/drivers/net/hamradio/6pack.c @@ -247,6 +247,9 @@ static netdev_tx_t sp_xmit(struct sk_buff *skb, struct net_device *dev) { struct sixpack *sp = netdev_priv(dev); + if (skb->protocol == htons(ETH_P_IP)) + return ax25_ip_xmit(skb); + spin_lock_bh(&sp->lock); /* We were not busy, so we are now... :-) */ netif_stop_queue(dev); @@ -302,7 +305,6 @@ static const struct net_device_ops sp_netdev_ops = { .ndo_stop = sp_close, .ndo_start_xmit = sp_xmit, .ndo_set_mac_address = sp_set_mac_address, - .ndo_neigh_construct = ax25_neigh_construct, }; static void sp_setup(struct net_device *dev) @@ -316,7 +318,6 @@ static void sp_setup(struct net_device *dev) dev->addr_len = AX25_ADDR_LEN; dev->type = ARPHRD_AX25; - dev->neigh_priv_len = sizeof(struct ax25_neigh_priv); dev->tx_queue_len = 10; /* Only activated in AX.25 mode */ -- cgit v1.2.3-59-g8ed1b