Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

appletalk: remove special handling code for ipddp

After commit 1dab47139e61 ("appletalk: remove ipddp driver") removes the
config IPDDP, there is some minor code clean-up possible in the appletalk
network layer.

Remove some code in appletalk layer after the ipddp driver is gone.

Signed-off-by: Lukas Bulwahn <lukas.bulwahn@gmail.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://lore.kernel.org/r/20231012063443.22368-1-lukas.bulwahn@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Lukas Bulwahn and committed by
Jakub Kicinski
85605fb6 a0252736

-36
-36
net/appletalk/ddp.c
··· 1284 1284 return err; 1285 1285 } 1286 1286 1287 - #if IS_ENABLED(CONFIG_IPDDP) 1288 - static __inline__ int is_ip_over_ddp(struct sk_buff *skb) 1289 - { 1290 - return skb->data[12] == 22; 1291 - } 1292 - 1293 - static int handle_ip_over_ddp(struct sk_buff *skb) 1294 - { 1295 - struct net_device *dev = __dev_get_by_name(&init_net, "ipddp0"); 1296 - struct net_device_stats *stats; 1297 - 1298 - /* This needs to be able to handle ipddp"N" devices */ 1299 - if (!dev) { 1300 - kfree_skb(skb); 1301 - return NET_RX_DROP; 1302 - } 1303 - 1304 - skb->protocol = htons(ETH_P_IP); 1305 - skb_pull(skb, 13); 1306 - skb->dev = dev; 1307 - skb_reset_transport_header(skb); 1308 - 1309 - stats = netdev_priv(dev); 1310 - stats->rx_packets++; 1311 - stats->rx_bytes += skb->len + 13; 1312 - return netif_rx(skb); /* Send the SKB up to a higher place. */ 1313 - } 1314 - #else 1315 - /* make it easy for gcc to optimize this test out, i.e. kill the code */ 1316 - #define is_ip_over_ddp(skb) 0 1317 - #define handle_ip_over_ddp(skb) 0 1318 - #endif 1319 - 1320 1287 static int atalk_route_packet(struct sk_buff *skb, struct net_device *dev, 1321 1288 struct ddpehdr *ddp, __u16 len_hops, int origlen) 1322 1289 { ··· 1447 1480 return atalk_route_packet(skb, dev, ddp, len_hops, origlen); 1448 1481 } 1449 1482 1450 - /* if IP over DDP is not selected this code will be optimized out */ 1451 - if (is_ip_over_ddp(skb)) 1452 - return handle_ip_over_ddp(skb); 1453 1483 /* 1454 1484 * Which socket - atalk_search_socket() looks for a *full match* 1455 1485 * of the <net, node, port> tuple.