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

net: make neigh_ops constant

These tables are never modified at runtime. Move to read-only
section.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Stephen Hemminger and committed by
David S. Miller
89d69d2b dcbfef82

+13 -13
+1 -1
include/net/arp.h
··· 26 26 const unsigned char *target_hw); 27 27 extern void arp_xmit(struct sk_buff *skb); 28 28 29 - extern struct neigh_ops arp_broken_ops; 29 + extern const struct neigh_ops arp_broken_ops; 30 30 31 31 #endif /* _ARP_H */
+1 -1
include/net/neighbour.h
··· 118 118 int (*output)(struct sk_buff *skb); 119 119 struct sk_buff_head arp_queue; 120 120 struct timer_list timer; 121 - struct neigh_ops *ops; 121 + const struct neigh_ops *ops; 122 122 u8 primary_key[0]; 123 123 }; 124 124
+1 -1
net/atm/clip.c
··· 267 267 kfree_skb(skb); 268 268 } 269 269 270 - static struct neigh_ops clip_neigh_ops = { 270 + static const struct neigh_ops clip_neigh_ops = { 271 271 .family = AF_INET, 272 272 .solicit = clip_neigh_solicit, 273 273 .error_report = clip_neigh_error,
+3 -3
net/decnet/dn_neigh.c
··· 59 59 /* 60 60 * For talking to broadcast devices: Ethernet & PPP 61 61 */ 62 - static struct neigh_ops dn_long_ops = { 62 + static const struct neigh_ops dn_long_ops = { 63 63 .family = AF_DECnet, 64 64 .error_report = dn_long_error_report, 65 65 .output = dn_long_output, ··· 71 71 /* 72 72 * For talking to pointopoint and multidrop devices: DDCMP and X.25 73 73 */ 74 - static struct neigh_ops dn_short_ops = { 74 + static const struct neigh_ops dn_short_ops = { 75 75 .family = AF_DECnet, 76 76 .error_report = dn_short_error_report, 77 77 .output = dn_short_output, ··· 83 83 /* 84 84 * For talking to DECnet phase III nodes 85 85 */ 86 - static struct neigh_ops dn_phase3_ops = { 86 + static const struct neigh_ops dn_phase3_ops = { 87 87 .family = AF_DECnet, 88 88 .error_report = dn_short_error_report, /* Can use short version here */ 89 89 .output = dn_phase3_output,
+4 -4
net/ipv4/arp.c
··· 130 130 static void arp_error_report(struct neighbour *neigh, struct sk_buff *skb); 131 131 static void parp_redo(struct sk_buff *skb); 132 132 133 - static struct neigh_ops arp_generic_ops = { 133 + static const struct neigh_ops arp_generic_ops = { 134 134 .family = AF_INET, 135 135 .solicit = arp_solicit, 136 136 .error_report = arp_error_report, ··· 140 140 .queue_xmit = dev_queue_xmit, 141 141 }; 142 142 143 - static struct neigh_ops arp_hh_ops = { 143 + static const struct neigh_ops arp_hh_ops = { 144 144 .family = AF_INET, 145 145 .solicit = arp_solicit, 146 146 .error_report = arp_error_report, ··· 150 150 .queue_xmit = dev_queue_xmit, 151 151 }; 152 152 153 - static struct neigh_ops arp_direct_ops = { 153 + static const struct neigh_ops arp_direct_ops = { 154 154 .family = AF_INET, 155 155 .output = dev_queue_xmit, 156 156 .connected_output = dev_queue_xmit, ··· 158 158 .queue_xmit = dev_queue_xmit, 159 159 }; 160 160 161 - struct neigh_ops arp_broken_ops = { 161 + const struct neigh_ops arp_broken_ops = { 162 162 .family = AF_INET, 163 163 .solicit = arp_solicit, 164 164 .error_report = arp_error_report,
+3 -3
net/ipv6/ndisc.c
··· 98 98 static void pndisc_destructor(struct pneigh_entry *n); 99 99 static void pndisc_redo(struct sk_buff *skb); 100 100 101 - static struct neigh_ops ndisc_generic_ops = { 101 + static const struct neigh_ops ndisc_generic_ops = { 102 102 .family = AF_INET6, 103 103 .solicit = ndisc_solicit, 104 104 .error_report = ndisc_error_report, ··· 108 108 .queue_xmit = dev_queue_xmit, 109 109 }; 110 110 111 - static struct neigh_ops ndisc_hh_ops = { 111 + static const struct neigh_ops ndisc_hh_ops = { 112 112 .family = AF_INET6, 113 113 .solicit = ndisc_solicit, 114 114 .error_report = ndisc_error_report, ··· 119 119 }; 120 120 121 121 122 - static struct neigh_ops ndisc_direct_ops = { 122 + static const struct neigh_ops ndisc_direct_ops = { 123 123 .family = AF_INET6, 124 124 .output = dev_queue_xmit, 125 125 .connected_output = dev_queue_xmit,