net: make neigh_ops constant
authorStephen Hemminger <shemminger@vyatta.com>
Tue, 1 Sep 2009 11:13:19 +0000 (11:13 +0000)
committerDavid S. Miller <davem@davemloft.net>
Wed, 2 Sep 2009 00:40:57 +0000 (17:40 -0700)
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>
include/net/arp.h
include/net/neighbour.h
net/atm/clip.c
net/decnet/dn_neigh.c
net/ipv4/arp.c
net/ipv6/ndisc.c

index c236270ec95ee63566e67f52004636004f912c6a..716f43c5c98eb92061cc2eb416c270ea8c68cd4a 100644 (file)
@@ -26,6 +26,6 @@ extern struct sk_buff *arp_create(int type, int ptype, __be32 dest_ip,
                                  const unsigned char *target_hw);
 extern void arp_xmit(struct sk_buff *skb);
 
-extern struct neigh_ops arp_broken_ops;
+extern const struct neigh_ops arp_broken_ops;
 
 #endif /* _ARP_H */
index 18b69b6cecaf6e91d161d67057e1ae0fadfef1ef..3817fda82a80760cc977082311ec9dd805b651aa 100644 (file)
@@ -118,7 +118,7 @@ struct neighbour
        int                     (*output)(struct sk_buff *skb);
        struct sk_buff_head     arp_queue;
        struct timer_list       timer;
-       struct neigh_ops        *ops;
+       const struct neigh_ops  *ops;
        u8                      primary_key[0];
 };
 
index 27f6852ce19041eb9b585745a1d567ee602b3c00..64629c354343d6debd8a8c105ef5b86c7ca0456b 100644 (file)
@@ -267,7 +267,7 @@ static void clip_neigh_error(struct neighbour *neigh, struct sk_buff *skb)
        kfree_skb(skb);
 }
 
-static struct neigh_ops clip_neigh_ops = {
+static const struct neigh_ops clip_neigh_ops = {
        .family =               AF_INET,
        .solicit =              clip_neigh_solicit,
        .error_report =         clip_neigh_error,
index 923786bd6d016044bafc5aed4c2b6a38122af7c7..794b5bf95af1af0512ee10f2b4884a056ddae9ab 100644 (file)
@@ -59,7 +59,7 @@ static int dn_phase3_output(struct sk_buff *);
 /*
  * For talking to broadcast devices: Ethernet & PPP
  */
-static struct neigh_ops dn_long_ops = {
+static const struct neigh_ops dn_long_ops = {
        .family =               AF_DECnet,
        .error_report =         dn_long_error_report,
        .output =               dn_long_output,
@@ -71,7 +71,7 @@ static struct neigh_ops dn_long_ops = {
 /*
  * For talking to pointopoint and multidrop devices: DDCMP and X.25
  */
-static struct neigh_ops dn_short_ops = {
+static const struct neigh_ops dn_short_ops = {
        .family =               AF_DECnet,
        .error_report =         dn_short_error_report,
        .output =               dn_short_output,
@@ -83,7 +83,7 @@ static struct neigh_ops dn_short_ops = {
 /*
  * For talking to DECnet phase III nodes
  */
-static struct neigh_ops dn_phase3_ops = {
+static const struct neigh_ops dn_phase3_ops = {
        .family =               AF_DECnet,
        .error_report =         dn_short_error_report, /* Can use short version here */
        .output =               dn_phase3_output,
index 090e9991ac2a288f31f378ad327b4c18a2b8ecba..4e80f336c0cf40c923192906ee02dc7c5472b8ca 100644 (file)
@@ -130,7 +130,7 @@ static void arp_solicit(struct neighbour *neigh, struct sk_buff *skb);
 static void arp_error_report(struct neighbour *neigh, struct sk_buff *skb);
 static void parp_redo(struct sk_buff *skb);
 
-static struct neigh_ops arp_generic_ops = {
+static const struct neigh_ops arp_generic_ops = {
        .family =               AF_INET,
        .solicit =              arp_solicit,
        .error_report =         arp_error_report,
@@ -140,7 +140,7 @@ static struct neigh_ops arp_generic_ops = {
        .queue_xmit =           dev_queue_xmit,
 };
 
-static struct neigh_ops arp_hh_ops = {
+static const struct neigh_ops arp_hh_ops = {
        .family =               AF_INET,
        .solicit =              arp_solicit,
        .error_report =         arp_error_report,
@@ -150,7 +150,7 @@ static struct neigh_ops arp_hh_ops = {
        .queue_xmit =           dev_queue_xmit,
 };
 
-static struct neigh_ops arp_direct_ops = {
+static const struct neigh_ops arp_direct_ops = {
        .family =               AF_INET,
        .output =               dev_queue_xmit,
        .connected_output =     dev_queue_xmit,
@@ -158,7 +158,7 @@ static struct neigh_ops arp_direct_ops = {
        .queue_xmit =           dev_queue_xmit,
 };
 
-struct neigh_ops arp_broken_ops = {
+const struct neigh_ops arp_broken_ops = {
        .family =               AF_INET,
        .solicit =              arp_solicit,
        .error_report =         arp_error_report,
index 44b4c87e5cce78d63be6cc7814f095c464e4c930..7015478797f667be60b94c762302ce24593d1fef 100644 (file)
@@ -98,7 +98,7 @@ static int pndisc_constructor(struct pneigh_entry *n);
 static void pndisc_destructor(struct pneigh_entry *n);
 static void pndisc_redo(struct sk_buff *skb);
 
-static struct neigh_ops ndisc_generic_ops = {
+static const struct neigh_ops ndisc_generic_ops = {
        .family =               AF_INET6,
        .solicit =              ndisc_solicit,
        .error_report =         ndisc_error_report,
@@ -108,7 +108,7 @@ static struct neigh_ops ndisc_generic_ops = {
        .queue_xmit =           dev_queue_xmit,
 };
 
-static struct neigh_ops ndisc_hh_ops = {
+static const struct neigh_ops ndisc_hh_ops = {
        .family =               AF_INET6,
        .solicit =              ndisc_solicit,
        .error_report =         ndisc_error_report,
@@ -119,7 +119,7 @@ static struct neigh_ops ndisc_hh_ops = {
 };
 
 
-static struct neigh_ops ndisc_direct_ops = {
+static const struct neigh_ops ndisc_direct_ops = {
        .family =               AF_INET6,
        .output =               dev_queue_xmit,
        .connected_output =     dev_queue_xmit,