aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephen Hemminger <shemminger@vyatta.com>2009-09-01 07:13:19 -0400
committerDavid S. Miller <davem@davemloft.net>2009-09-01 20:40:57 -0400
commit89d69d2b75a8f7e258f4b634cd985374cfd3202e (patch)
tree2f01d6ae1844c92ef09160ad1966edee34ee2d8a
parentdcbfef820bdd1cdb412ccf234840e23edf67014f (diff)
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>
-rw-r--r--include/net/arp.h2
-rw-r--r--include/net/neighbour.h2
-rw-r--r--net/atm/clip.c2
-rw-r--r--net/decnet/dn_neigh.c6
-rw-r--r--net/ipv4/arp.c8
-rw-r--r--net/ipv6/ndisc.c6
6 files changed, 13 insertions, 13 deletions
diff --git a/include/net/arp.h b/include/net/arp.h
index c236270ec95e..716f43c5c98e 100644
--- a/include/net/arp.h
+++ b/include/net/arp.h
@@ -26,6 +26,6 @@ extern struct sk_buff *arp_create(int type, int ptype, __be32 dest_ip,
26 const unsigned char *target_hw); 26 const unsigned char *target_hw);
27extern void arp_xmit(struct sk_buff *skb); 27extern void arp_xmit(struct sk_buff *skb);
28 28
29extern struct neigh_ops arp_broken_ops; 29extern const struct neigh_ops arp_broken_ops;
30 30
31#endif /* _ARP_H */ 31#endif /* _ARP_H */
diff --git a/include/net/neighbour.h b/include/net/neighbour.h
index 18b69b6cecaf..3817fda82a80 100644
--- a/include/net/neighbour.h
+++ b/include/net/neighbour.h
@@ -118,7 +118,7 @@ struct neighbour
118 int (*output)(struct sk_buff *skb); 118 int (*output)(struct sk_buff *skb);
119 struct sk_buff_head arp_queue; 119 struct sk_buff_head arp_queue;
120 struct timer_list timer; 120 struct timer_list timer;
121 struct neigh_ops *ops; 121 const struct neigh_ops *ops;
122 u8 primary_key[0]; 122 u8 primary_key[0];
123}; 123};
124 124
diff --git a/net/atm/clip.c b/net/atm/clip.c
index 27f6852ce190..64629c354343 100644
--- a/net/atm/clip.c
+++ b/net/atm/clip.c
@@ -267,7 +267,7 @@ static void clip_neigh_error(struct neighbour *neigh, struct sk_buff *skb)
267 kfree_skb(skb); 267 kfree_skb(skb);
268} 268}
269 269
270static struct neigh_ops clip_neigh_ops = { 270static const struct neigh_ops clip_neigh_ops = {
271 .family = AF_INET, 271 .family = AF_INET,
272 .solicit = clip_neigh_solicit, 272 .solicit = clip_neigh_solicit,
273 .error_report = clip_neigh_error, 273 .error_report = clip_neigh_error,
diff --git a/net/decnet/dn_neigh.c b/net/decnet/dn_neigh.c
index 923786bd6d01..794b5bf95af1 100644
--- a/net/decnet/dn_neigh.c
+++ b/net/decnet/dn_neigh.c
@@ -59,7 +59,7 @@ static int dn_phase3_output(struct sk_buff *);
59/* 59/*
60 * For talking to broadcast devices: Ethernet & PPP 60 * For talking to broadcast devices: Ethernet & PPP
61 */ 61 */
62static struct neigh_ops dn_long_ops = { 62static const struct neigh_ops dn_long_ops = {
63 .family = AF_DECnet, 63 .family = AF_DECnet,
64 .error_report = dn_long_error_report, 64 .error_report = dn_long_error_report,
65 .output = dn_long_output, 65 .output = dn_long_output,
@@ -71,7 +71,7 @@ static struct neigh_ops dn_long_ops = {
71/* 71/*
72 * For talking to pointopoint and multidrop devices: DDCMP and X.25 72 * For talking to pointopoint and multidrop devices: DDCMP and X.25
73 */ 73 */
74static struct neigh_ops dn_short_ops = { 74static const struct neigh_ops dn_short_ops = {
75 .family = AF_DECnet, 75 .family = AF_DECnet,
76 .error_report = dn_short_error_report, 76 .error_report = dn_short_error_report,
77 .output = dn_short_output, 77 .output = dn_short_output,
@@ -83,7 +83,7 @@ static struct neigh_ops dn_short_ops = {
83/* 83/*
84 * For talking to DECnet phase III nodes 84 * For talking to DECnet phase III nodes
85 */ 85 */
86static struct neigh_ops dn_phase3_ops = { 86static const struct neigh_ops dn_phase3_ops = {
87 .family = AF_DECnet, 87 .family = AF_DECnet,
88 .error_report = dn_short_error_report, /* Can use short version here */ 88 .error_report = dn_short_error_report, /* Can use short version here */
89 .output = dn_phase3_output, 89 .output = dn_phase3_output,
diff --git a/net/ipv4/arp.c b/net/ipv4/arp.c
index 090e9991ac2a..4e80f336c0cf 100644
--- a/net/ipv4/arp.c
+++ b/net/ipv4/arp.c
@@ -130,7 +130,7 @@ static void arp_solicit(struct neighbour *neigh, struct sk_buff *skb);
130static void arp_error_report(struct neighbour *neigh, struct sk_buff *skb); 130static void arp_error_report(struct neighbour *neigh, struct sk_buff *skb);
131static void parp_redo(struct sk_buff *skb); 131static void parp_redo(struct sk_buff *skb);
132 132
133static struct neigh_ops arp_generic_ops = { 133static const struct neigh_ops arp_generic_ops = {
134 .family = AF_INET, 134 .family = AF_INET,
135 .solicit = arp_solicit, 135 .solicit = arp_solicit,
136 .error_report = arp_error_report, 136 .error_report = arp_error_report,
@@ -140,7 +140,7 @@ static struct neigh_ops arp_generic_ops = {
140 .queue_xmit = dev_queue_xmit, 140 .queue_xmit = dev_queue_xmit,
141}; 141};
142 142
143static struct neigh_ops arp_hh_ops = { 143static const struct neigh_ops arp_hh_ops = {
144 .family = AF_INET, 144 .family = AF_INET,
145 .solicit = arp_solicit, 145 .solicit = arp_solicit,
146 .error_report = arp_error_report, 146 .error_report = arp_error_report,
@@ -150,7 +150,7 @@ static struct neigh_ops arp_hh_ops = {
150 .queue_xmit = dev_queue_xmit, 150 .queue_xmit = dev_queue_xmit,
151}; 151};
152 152
153static struct neigh_ops arp_direct_ops = { 153static const struct neigh_ops arp_direct_ops = {
154 .family = AF_INET, 154 .family = AF_INET,
155 .output = dev_queue_xmit, 155 .output = dev_queue_xmit,
156 .connected_output = dev_queue_xmit, 156 .connected_output = dev_queue_xmit,
@@ -158,7 +158,7 @@ static struct neigh_ops arp_direct_ops = {
158 .queue_xmit = dev_queue_xmit, 158 .queue_xmit = dev_queue_xmit,
159}; 159};
160 160
161struct neigh_ops arp_broken_ops = { 161const struct neigh_ops arp_broken_ops = {
162 .family = AF_INET, 162 .family = AF_INET,
163 .solicit = arp_solicit, 163 .solicit = arp_solicit,
164 .error_report = arp_error_report, 164 .error_report = arp_error_report,
diff --git a/net/ipv6/ndisc.c b/net/ipv6/ndisc.c
index 44b4c87e5cce..7015478797f6 100644
--- a/net/ipv6/ndisc.c
+++ b/net/ipv6/ndisc.c
@@ -98,7 +98,7 @@ static int pndisc_constructor(struct pneigh_entry *n);
98static void pndisc_destructor(struct pneigh_entry *n); 98static void pndisc_destructor(struct pneigh_entry *n);
99static void pndisc_redo(struct sk_buff *skb); 99static void pndisc_redo(struct sk_buff *skb);
100 100
101static struct neigh_ops ndisc_generic_ops = { 101static const struct neigh_ops ndisc_generic_ops = {
102 .family = AF_INET6, 102 .family = AF_INET6,
103 .solicit = ndisc_solicit, 103 .solicit = ndisc_solicit,
104 .error_report = ndisc_error_report, 104 .error_report = ndisc_error_report,
@@ -108,7 +108,7 @@ static struct neigh_ops ndisc_generic_ops = {
108 .queue_xmit = dev_queue_xmit, 108 .queue_xmit = dev_queue_xmit,
109}; 109};
110 110
111static struct neigh_ops ndisc_hh_ops = { 111static const struct neigh_ops ndisc_hh_ops = {
112 .family = AF_INET6, 112 .family = AF_INET6,
113 .solicit = ndisc_solicit, 113 .solicit = ndisc_solicit,
114 .error_report = ndisc_error_report, 114 .error_report = ndisc_error_report,
@@ -119,7 +119,7 @@ static struct neigh_ops ndisc_hh_ops = {
119}; 119};
120 120
121 121
122static struct neigh_ops ndisc_direct_ops = { 122static const struct neigh_ops ndisc_direct_ops = {
123 .family = AF_INET6, 123 .family = AF_INET6,
124 .output = dev_queue_xmit, 124 .output = dev_queue_xmit,
125 .connected_output = dev_queue_xmit, 125 .connected_output = dev_queue_xmit,