diff options
author | Patrick McHardy <kaber@trash.net> | 2007-06-05 15:38:30 -0400 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2007-06-07 16:40:10 -0400 |
commit | ef7c79ed645f52bcbdd88f8d54a9702c4d3fd15d (patch) | |
tree | 4c27ec3362d958b99672366437d5eb6038dd561d /net | |
parent | 14a49e1fd2bb91ba2bf0e1f06711b6dbc21de02d (diff) |
[NETLINK]: Mark netlink policies const
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r-- | net/core/neighbour.c | 4 | ||||
-rw-r--r-- | net/core/rtnetlink.c | 2 | ||||
-rw-r--r-- | net/decnet/dn_dev.c | 2 | ||||
-rw-r--r-- | net/decnet/dn_rules.c | 2 | ||||
-rw-r--r-- | net/ipv4/devinet.c | 2 | ||||
-rw-r--r-- | net/ipv4/fib_frontend.c | 2 | ||||
-rw-r--r-- | net/ipv4/fib_rules.c | 2 | ||||
-rw-r--r-- | net/ipv6/addrconf.c | 2 | ||||
-rw-r--r-- | net/ipv6/fib6_rules.c | 2 | ||||
-rw-r--r-- | net/ipv6/route.c | 2 | ||||
-rw-r--r-- | net/netlabel/netlabel_cipso_v4.c | 2 | ||||
-rw-r--r-- | net/netlabel/netlabel_mgmt.c | 2 | ||||
-rw-r--r-- | net/netlabel/netlabel_unlabeled.c | 2 | ||||
-rw-r--r-- | net/netlink/attr.c | 8 | ||||
-rw-r--r-- | net/netlink/genetlink.c | 2 |
15 files changed, 19 insertions, 19 deletions
diff --git a/net/core/neighbour.c b/net/core/neighbour.c index 6f3bb73053c2..9df26a07f067 100644 --- a/net/core/neighbour.c +++ b/net/core/neighbour.c | |||
@@ -1761,7 +1761,7 @@ static inline struct neigh_parms *lookup_neigh_params(struct neigh_table *tbl, | |||
1761 | return NULL; | 1761 | return NULL; |
1762 | } | 1762 | } |
1763 | 1763 | ||
1764 | static struct nla_policy nl_neightbl_policy[NDTA_MAX+1] __read_mostly = { | 1764 | static const struct nla_policy nl_neightbl_policy[NDTA_MAX+1] = { |
1765 | [NDTA_NAME] = { .type = NLA_STRING }, | 1765 | [NDTA_NAME] = { .type = NLA_STRING }, |
1766 | [NDTA_THRESH1] = { .type = NLA_U32 }, | 1766 | [NDTA_THRESH1] = { .type = NLA_U32 }, |
1767 | [NDTA_THRESH2] = { .type = NLA_U32 }, | 1767 | [NDTA_THRESH2] = { .type = NLA_U32 }, |
@@ -1770,7 +1770,7 @@ static struct nla_policy nl_neightbl_policy[NDTA_MAX+1] __read_mostly = { | |||
1770 | [NDTA_PARMS] = { .type = NLA_NESTED }, | 1770 | [NDTA_PARMS] = { .type = NLA_NESTED }, |
1771 | }; | 1771 | }; |
1772 | 1772 | ||
1773 | static struct nla_policy nl_ntbl_parm_policy[NDTPA_MAX+1] __read_mostly = { | 1773 | static const struct nla_policy nl_ntbl_parm_policy[NDTPA_MAX+1] = { |
1774 | [NDTPA_IFINDEX] = { .type = NLA_U32 }, | 1774 | [NDTPA_IFINDEX] = { .type = NLA_U32 }, |
1775 | [NDTPA_QUEUE_LEN] = { .type = NLA_U32 }, | 1775 | [NDTPA_QUEUE_LEN] = { .type = NLA_U32 }, |
1776 | [NDTPA_PROXY_QLEN] = { .type = NLA_U32 }, | 1776 | [NDTPA_PROXY_QLEN] = { .type = NLA_U32 }, |
diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c index 27da9cdec6a8..a8a5093a3001 100644 --- a/net/core/rtnetlink.c +++ b/net/core/rtnetlink.c | |||
@@ -551,7 +551,7 @@ cont: | |||
551 | return skb->len; | 551 | return skb->len; |
552 | } | 552 | } |
553 | 553 | ||
554 | static struct nla_policy ifla_policy[IFLA_MAX+1] __read_mostly = { | 554 | static const struct nla_policy ifla_policy[IFLA_MAX+1] = { |
555 | [IFLA_IFNAME] = { .type = NLA_STRING, .len = IFNAMSIZ-1 }, | 555 | [IFLA_IFNAME] = { .type = NLA_STRING, .len = IFNAMSIZ-1 }, |
556 | [IFLA_MAP] = { .len = sizeof(struct rtnl_link_ifmap) }, | 556 | [IFLA_MAP] = { .len = sizeof(struct rtnl_link_ifmap) }, |
557 | [IFLA_MTU] = { .type = NLA_U32 }, | 557 | [IFLA_MTU] = { .type = NLA_U32 }, |
diff --git a/net/decnet/dn_dev.c b/net/decnet/dn_dev.c index 764a56a13e38..ab41c1879fd4 100644 --- a/net/decnet/dn_dev.c +++ b/net/decnet/dn_dev.c | |||
@@ -638,7 +638,7 @@ static struct dn_dev *dn_dev_by_index(int ifindex) | |||
638 | return dn_dev; | 638 | return dn_dev; |
639 | } | 639 | } |
640 | 640 | ||
641 | static struct nla_policy dn_ifa_policy[IFA_MAX+1] __read_mostly = { | 641 | static const struct nla_policy dn_ifa_policy[IFA_MAX+1] = { |
642 | [IFA_ADDRESS] = { .type = NLA_U16 }, | 642 | [IFA_ADDRESS] = { .type = NLA_U16 }, |
643 | [IFA_LOCAL] = { .type = NLA_U16 }, | 643 | [IFA_LOCAL] = { .type = NLA_U16 }, |
644 | [IFA_LABEL] = { .type = NLA_STRING, | 644 | [IFA_LABEL] = { .type = NLA_STRING, |
diff --git a/net/decnet/dn_rules.c b/net/decnet/dn_rules.c index 17a1932216d6..84ff3dd37070 100644 --- a/net/decnet/dn_rules.c +++ b/net/decnet/dn_rules.c | |||
@@ -108,7 +108,7 @@ errout: | |||
108 | return err; | 108 | return err; |
109 | } | 109 | } |
110 | 110 | ||
111 | static struct nla_policy dn_fib_rule_policy[FRA_MAX+1] __read_mostly = { | 111 | static const struct nla_policy dn_fib_rule_policy[FRA_MAX+1] = { |
112 | FRA_GENERIC_POLICY, | 112 | FRA_GENERIC_POLICY, |
113 | }; | 113 | }; |
114 | 114 | ||
diff --git a/net/ipv4/devinet.c b/net/ipv4/devinet.c index 354e800be18d..fa97b96a3d89 100644 --- a/net/ipv4/devinet.c +++ b/net/ipv4/devinet.c | |||
@@ -84,7 +84,7 @@ static struct ipv4_devconf ipv4_devconf_dflt = { | |||
84 | 84 | ||
85 | #define IPV4_DEVCONF_DFLT(attr) IPV4_DEVCONF(ipv4_devconf_dflt, attr) | 85 | #define IPV4_DEVCONF_DFLT(attr) IPV4_DEVCONF(ipv4_devconf_dflt, attr) |
86 | 86 | ||
87 | static struct nla_policy ifa_ipv4_policy[IFA_MAX+1] __read_mostly = { | 87 | static const struct nla_policy ifa_ipv4_policy[IFA_MAX+1] = { |
88 | [IFA_LOCAL] = { .type = NLA_U32 }, | 88 | [IFA_LOCAL] = { .type = NLA_U32 }, |
89 | [IFA_ADDRESS] = { .type = NLA_U32 }, | 89 | [IFA_ADDRESS] = { .type = NLA_U32 }, |
90 | [IFA_BROADCAST] = { .type = NLA_U32 }, | 90 | [IFA_BROADCAST] = { .type = NLA_U32 }, |
diff --git a/net/ipv4/fib_frontend.c b/net/ipv4/fib_frontend.c index 9ad1f6252a97..311d633f7f39 100644 --- a/net/ipv4/fib_frontend.c +++ b/net/ipv4/fib_frontend.c | |||
@@ -441,7 +441,7 @@ int ip_rt_ioctl(unsigned int cmd, void __user *arg) | |||
441 | return -EINVAL; | 441 | return -EINVAL; |
442 | } | 442 | } |
443 | 443 | ||
444 | struct nla_policy rtm_ipv4_policy[RTA_MAX+1] __read_mostly = { | 444 | const struct nla_policy rtm_ipv4_policy[RTA_MAX+1] = { |
445 | [RTA_DST] = { .type = NLA_U32 }, | 445 | [RTA_DST] = { .type = NLA_U32 }, |
446 | [RTA_SRC] = { .type = NLA_U32 }, | 446 | [RTA_SRC] = { .type = NLA_U32 }, |
447 | [RTA_IIF] = { .type = NLA_U32 }, | 447 | [RTA_IIF] = { .type = NLA_U32 }, |
diff --git a/net/ipv4/fib_rules.c b/net/ipv4/fib_rules.c index 33083ad52e9f..2a947840210e 100644 --- a/net/ipv4/fib_rules.c +++ b/net/ipv4/fib_rules.c | |||
@@ -169,7 +169,7 @@ static struct fib_table *fib_empty_table(void) | |||
169 | return NULL; | 169 | return NULL; |
170 | } | 170 | } |
171 | 171 | ||
172 | static struct nla_policy fib4_rule_policy[FRA_MAX+1] __read_mostly = { | 172 | static const struct nla_policy fib4_rule_policy[FRA_MAX+1] = { |
173 | FRA_GENERIC_POLICY, | 173 | FRA_GENERIC_POLICY, |
174 | [FRA_FLOW] = { .type = NLA_U32 }, | 174 | [FRA_FLOW] = { .type = NLA_U32 }, |
175 | }; | 175 | }; |
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c index 329de679ac38..5a5f8bd4597a 100644 --- a/net/ipv6/addrconf.c +++ b/net/ipv6/addrconf.c | |||
@@ -2990,7 +2990,7 @@ static struct in6_addr *extract_addr(struct nlattr *addr, struct nlattr *local) | |||
2990 | return pfx; | 2990 | return pfx; |
2991 | } | 2991 | } |
2992 | 2992 | ||
2993 | static struct nla_policy ifa_ipv6_policy[IFA_MAX+1] __read_mostly = { | 2993 | static const struct nla_policy ifa_ipv6_policy[IFA_MAX+1] = { |
2994 | [IFA_ADDRESS] = { .len = sizeof(struct in6_addr) }, | 2994 | [IFA_ADDRESS] = { .len = sizeof(struct in6_addr) }, |
2995 | [IFA_LOCAL] = { .len = sizeof(struct in6_addr) }, | 2995 | [IFA_LOCAL] = { .len = sizeof(struct in6_addr) }, |
2996 | [IFA_CACHEINFO] = { .len = sizeof(struct ifa_cacheinfo) }, | 2996 | [IFA_CACHEINFO] = { .len = sizeof(struct ifa_cacheinfo) }, |
diff --git a/net/ipv6/fib6_rules.c b/net/ipv6/fib6_rules.c index fc3882c90604..53b3998a486c 100644 --- a/net/ipv6/fib6_rules.c +++ b/net/ipv6/fib6_rules.c | |||
@@ -157,7 +157,7 @@ static int fib6_rule_match(struct fib_rule *rule, struct flowi *fl, int flags) | |||
157 | return 1; | 157 | return 1; |
158 | } | 158 | } |
159 | 159 | ||
160 | static struct nla_policy fib6_rule_policy[FRA_MAX+1] __read_mostly = { | 160 | static const struct nla_policy fib6_rule_policy[FRA_MAX+1] = { |
161 | FRA_GENERIC_POLICY, | 161 | FRA_GENERIC_POLICY, |
162 | }; | 162 | }; |
163 | 163 | ||
diff --git a/net/ipv6/route.c b/net/ipv6/route.c index 1324b06796c0..fe8d9837f9f8 100644 --- a/net/ipv6/route.c +++ b/net/ipv6/route.c | |||
@@ -1999,7 +1999,7 @@ void rt6_mtu_change(struct net_device *dev, unsigned mtu) | |||
1999 | fib6_clean_all(rt6_mtu_change_route, 0, &arg); | 1999 | fib6_clean_all(rt6_mtu_change_route, 0, &arg); |
2000 | } | 2000 | } |
2001 | 2001 | ||
2002 | static struct nla_policy rtm_ipv6_policy[RTA_MAX+1] __read_mostly = { | 2002 | static const struct nla_policy rtm_ipv6_policy[RTA_MAX+1] = { |
2003 | [RTA_GATEWAY] = { .len = sizeof(struct in6_addr) }, | 2003 | [RTA_GATEWAY] = { .len = sizeof(struct in6_addr) }, |
2004 | [RTA_OIF] = { .type = NLA_U32 }, | 2004 | [RTA_OIF] = { .type = NLA_U32 }, |
2005 | [RTA_IIF] = { .type = NLA_U32 }, | 2005 | [RTA_IIF] = { .type = NLA_U32 }, |
diff --git a/net/netlabel/netlabel_cipso_v4.c b/net/netlabel/netlabel_cipso_v4.c index 07e47dbcb0a9..24b660f16ce3 100644 --- a/net/netlabel/netlabel_cipso_v4.c +++ b/net/netlabel/netlabel_cipso_v4.c | |||
@@ -59,7 +59,7 @@ static struct genl_family netlbl_cipsov4_gnl_family = { | |||
59 | }; | 59 | }; |
60 | 60 | ||
61 | /* NetLabel Netlink attribute policy */ | 61 | /* NetLabel Netlink attribute policy */ |
62 | static struct nla_policy netlbl_cipsov4_genl_policy[NLBL_CIPSOV4_A_MAX + 1] = { | 62 | static const struct nla_policy netlbl_cipsov4_genl_policy[NLBL_CIPSOV4_A_MAX + 1] = { |
63 | [NLBL_CIPSOV4_A_DOI] = { .type = NLA_U32 }, | 63 | [NLBL_CIPSOV4_A_DOI] = { .type = NLA_U32 }, |
64 | [NLBL_CIPSOV4_A_MTYPE] = { .type = NLA_U32 }, | 64 | [NLBL_CIPSOV4_A_MTYPE] = { .type = NLA_U32 }, |
65 | [NLBL_CIPSOV4_A_TAG] = { .type = NLA_U8 }, | 65 | [NLBL_CIPSOV4_A_TAG] = { .type = NLA_U8 }, |
diff --git a/net/netlabel/netlabel_mgmt.c b/net/netlabel/netlabel_mgmt.c index e8c80f33f3d7..e00fc219c72b 100644 --- a/net/netlabel/netlabel_mgmt.c +++ b/net/netlabel/netlabel_mgmt.c | |||
@@ -59,7 +59,7 @@ static struct genl_family netlbl_mgmt_gnl_family = { | |||
59 | }; | 59 | }; |
60 | 60 | ||
61 | /* NetLabel Netlink attribute policy */ | 61 | /* NetLabel Netlink attribute policy */ |
62 | static struct nla_policy netlbl_mgmt_genl_policy[NLBL_MGMT_A_MAX + 1] = { | 62 | static const struct nla_policy netlbl_mgmt_genl_policy[NLBL_MGMT_A_MAX + 1] = { |
63 | [NLBL_MGMT_A_DOMAIN] = { .type = NLA_NUL_STRING }, | 63 | [NLBL_MGMT_A_DOMAIN] = { .type = NLA_NUL_STRING }, |
64 | [NLBL_MGMT_A_PROTOCOL] = { .type = NLA_U32 }, | 64 | [NLBL_MGMT_A_PROTOCOL] = { .type = NLA_U32 }, |
65 | [NLBL_MGMT_A_VERSION] = { .type = NLA_U32 }, | 65 | [NLBL_MGMT_A_VERSION] = { .type = NLA_U32 }, |
diff --git a/net/netlabel/netlabel_unlabeled.c b/net/netlabel/netlabel_unlabeled.c index b931edee4b8b..5c303c68af1d 100644 --- a/net/netlabel/netlabel_unlabeled.c +++ b/net/netlabel/netlabel_unlabeled.c | |||
@@ -61,7 +61,7 @@ static struct genl_family netlbl_unlabel_gnl_family = { | |||
61 | }; | 61 | }; |
62 | 62 | ||
63 | /* NetLabel Netlink attribute policy */ | 63 | /* NetLabel Netlink attribute policy */ |
64 | static struct nla_policy netlbl_unlabel_genl_policy[NLBL_UNLABEL_A_MAX + 1] = { | 64 | static const struct nla_policy netlbl_unlabel_genl_policy[NLBL_UNLABEL_A_MAX + 1] = { |
65 | [NLBL_UNLABEL_A_ACPTFLG] = { .type = NLA_U8 }, | 65 | [NLBL_UNLABEL_A_ACPTFLG] = { .type = NLA_U8 }, |
66 | }; | 66 | }; |
67 | 67 | ||
diff --git a/net/netlink/attr.c b/net/netlink/attr.c index df5f820a4c32..c591212793ee 100644 --- a/net/netlink/attr.c +++ b/net/netlink/attr.c | |||
@@ -24,9 +24,9 @@ static u16 nla_attr_minlen[NLA_TYPE_MAX+1] __read_mostly = { | |||
24 | }; | 24 | }; |
25 | 25 | ||
26 | static int validate_nla(struct nlattr *nla, int maxtype, | 26 | static int validate_nla(struct nlattr *nla, int maxtype, |
27 | struct nla_policy *policy) | 27 | const struct nla_policy *policy) |
28 | { | 28 | { |
29 | struct nla_policy *pt; | 29 | const struct nla_policy *pt; |
30 | int minlen = 0, attrlen = nla_len(nla); | 30 | int minlen = 0, attrlen = nla_len(nla); |
31 | 31 | ||
32 | if (nla->nla_type <= 0 || nla->nla_type > maxtype) | 32 | if (nla->nla_type <= 0 || nla->nla_type > maxtype) |
@@ -99,7 +99,7 @@ static int validate_nla(struct nlattr *nla, int maxtype, | |||
99 | * Returns 0 on success or a negative error code. | 99 | * Returns 0 on success or a negative error code. |
100 | */ | 100 | */ |
101 | int nla_validate(struct nlattr *head, int len, int maxtype, | 101 | int nla_validate(struct nlattr *head, int len, int maxtype, |
102 | struct nla_policy *policy) | 102 | const struct nla_policy *policy) |
103 | { | 103 | { |
104 | struct nlattr *nla; | 104 | struct nlattr *nla; |
105 | int rem, err; | 105 | int rem, err; |
@@ -130,7 +130,7 @@ errout: | |||
130 | * Returns 0 on success or a negative error code. | 130 | * Returns 0 on success or a negative error code. |
131 | */ | 131 | */ |
132 | int nla_parse(struct nlattr *tb[], int maxtype, struct nlattr *head, int len, | 132 | int nla_parse(struct nlattr *tb[], int maxtype, struct nlattr *head, int len, |
133 | struct nla_policy *policy) | 133 | const struct nla_policy *policy) |
134 | { | 134 | { |
135 | struct nlattr *nla; | 135 | struct nlattr *nla; |
136 | int rem, err; | 136 | int rem, err; |
diff --git a/net/netlink/genetlink.c b/net/netlink/genetlink.c index 6e31234a4196..b9ab62f938d0 100644 --- a/net/netlink/genetlink.c +++ b/net/netlink/genetlink.c | |||
@@ -472,7 +472,7 @@ static struct sk_buff *ctrl_build_msg(struct genl_family *family, u32 pid, | |||
472 | return skb; | 472 | return skb; |
473 | } | 473 | } |
474 | 474 | ||
475 | static struct nla_policy ctrl_policy[CTRL_ATTR_MAX+1] __read_mostly = { | 475 | static const struct nla_policy ctrl_policy[CTRL_ATTR_MAX+1] = { |
476 | [CTRL_ATTR_FAMILY_ID] = { .type = NLA_U16 }, | 476 | [CTRL_ATTR_FAMILY_ID] = { .type = NLA_U16 }, |
477 | [CTRL_ATTR_FAMILY_NAME] = { .type = NLA_NUL_STRING, | 477 | [CTRL_ATTR_FAMILY_NAME] = { .type = NLA_NUL_STRING, |
478 | .len = GENL_NAMSIZ - 1 }, | 478 | .len = GENL_NAMSIZ - 1 }, |