Browse Source

[IPV4]: Make ip_tos2prio const.

Signed-off-by: Philippe De Muyter <phdm@macqel.be>
Signed-off-by: David S. Miller <davem@davemloft.net>
Philippe De Muyter 18 năm trước cách đây
mục cha
commit
4839c52b01
2 tập tin đã thay đổi với 2 bổ sung2 xóa
  1. 1 1
      include/net/route.h
  2. 1 1
      net/ipv4/route.c

+ 1 - 1
include/net/route.h

@@ -135,7 +135,7 @@ static inline void ip_rt_put(struct rtable * rt)
 
 
 #define IPTOS_RT_MASK	(IPTOS_TOS_MASK & ~3)
 #define IPTOS_RT_MASK	(IPTOS_TOS_MASK & ~3)
 
 
-extern __u8 ip_tos2prio[16];
+extern const __u8 ip_tos2prio[16];
 
 
 static inline char rt_tos2priority(u8 tos)
 static inline char rt_tos2priority(u8 tos)
 {
 {

+ 1 - 1
net/ipv4/route.c

@@ -167,7 +167,7 @@ static struct dst_ops ipv4_dst_ops = {
 
 
 #define ECN_OR_COST(class)	TC_PRIO_##class
 #define ECN_OR_COST(class)	TC_PRIO_##class
 
 
-__u8 ip_tos2prio[16] = {
+const __u8 ip_tos2prio[16] = {
 	TC_PRIO_BESTEFFORT,
 	TC_PRIO_BESTEFFORT,
 	ECN_OR_COST(FILLER),
 	ECN_OR_COST(FILLER),
 	TC_PRIO_BESTEFFORT,
 	TC_PRIO_BESTEFFORT,