| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * Generic HDLC support routines for Linux |
|---|
| 3 | 4 | * Cisco HDLC support |
|---|
| 4 | 5 | * |
|---|
| 5 | 6 | * Copyright (C) 2000 - 2006 Krzysztof Halasa <khc@pm.waw.pl> |
|---|
| 6 | | - * |
|---|
| 7 | | - * This program is free software; you can redistribute it and/or modify it |
|---|
| 8 | | - * under the terms of version 2 of the GNU General Public License |
|---|
| 9 | | - * as published by the Free Software Foundation. |
|---|
| 10 | 7 | */ |
|---|
| 11 | 8 | |
|---|
| 12 | 9 | #include <linux/errno.h> |
|---|
| .. | .. |
|---|
| 78 | 75 | { |
|---|
| 79 | 76 | struct hdlc_header *data; |
|---|
| 80 | 77 | #ifdef DEBUG_HARD_HEADER |
|---|
| 81 | | - printk(KERN_DEBUG "%s: cisco_hard_header called\n", dev->name); |
|---|
| 78 | + netdev_dbg(dev, "%s called\n", __func__); |
|---|
| 82 | 79 | #endif |
|---|
| 83 | 80 | |
|---|
| 84 | 81 | skb_push(skb, sizeof(struct hdlc_header)); |
|---|
| .. | .. |
|---|
| 104 | 101 | skb = dev_alloc_skb(sizeof(struct hdlc_header) + |
|---|
| 105 | 102 | sizeof(struct cisco_packet)); |
|---|
| 106 | 103 | if (!skb) { |
|---|
| 107 | | - netdev_warn(dev, "Memory squeeze on cisco_keepalive_send()\n"); |
|---|
| 104 | + netdev_warn(dev, "Memory squeeze on %s()\n", __func__); |
|---|
| 108 | 105 | return; |
|---|
| 109 | 106 | } |
|---|
| 110 | 107 | skb_reserve(skb, 4); |
|---|
| .. | .. |
|---|
| 197 | 194 | mask = ~cpu_to_be32(0); /* is the mask correct? */ |
|---|
| 198 | 195 | |
|---|
| 199 | 196 | if (in_dev != NULL) { |
|---|
| 200 | | - struct in_ifaddr **ifap = &in_dev->ifa_list; |
|---|
| 197 | + const struct in_ifaddr *ifa; |
|---|
| 201 | 198 | |
|---|
| 202 | | - while (*ifap != NULL) { |
|---|
| 199 | + in_dev_for_each_ifa_rcu(ifa, in_dev) { |
|---|
| 203 | 200 | if (strcmp(dev->name, |
|---|
| 204 | | - (*ifap)->ifa_label) == 0) { |
|---|
| 205 | | - addr = (*ifap)->ifa_local; |
|---|
| 206 | | - mask = (*ifap)->ifa_mask; |
|---|
| 201 | + ifa->ifa_label) == 0) { |
|---|
| 202 | + addr = ifa->ifa_local; |
|---|
| 203 | + mask = ifa->ifa_mask; |
|---|
| 207 | 204 | break; |
|---|
| 208 | 205 | } |
|---|
| 209 | | - ifap = &(*ifap)->ifa_next; |
|---|
| 210 | 206 | } |
|---|
| 211 | 207 | |
|---|
| 212 | 208 | cisco_keepalive_send(dev, CISCO_ADDR_REPLY, |
|---|