瀏覽代碼

tproxy: added const specifiers to udp lookup functions

The parameters for various UDP lookup functions were non-const, even though
they could be const. TProxy has some const references and instead of
downcasting it, I added const specifiers along the path.

Signed-off-by: Balazs Scheidler <bazsi@balabit.hu>
Signed-off-by: KOVACS Krisztian <hidden@balabit.hu>
Signed-off-by: Patrick McHardy <kaber@trash.net>
Balazs Scheidler 14 年之前
父節點
當前提交
88440ae70e
共有 1 個文件被更改,包括 4 次插入4 次删除
  1. 4 4
      net/ipv6/udp.c

+ 4 - 4
net/ipv6/udp.c

@@ -122,8 +122,8 @@ static void udp_v6_rehash(struct sock *sk)
 
 
 static inline int compute_score(struct sock *sk, struct net *net,
 static inline int compute_score(struct sock *sk, struct net *net,
 				unsigned short hnum,
 				unsigned short hnum,
-				struct in6_addr *saddr, __be16 sport,
-				struct in6_addr *daddr, __be16 dport,
+				const struct in6_addr *saddr, __be16 sport,
+				const struct in6_addr *daddr, __be16 dport,
 				int dif)
 				int dif)
 {
 {
 	int score = -1;
 	int score = -1;
@@ -239,8 +239,8 @@ exact_match:
 }
 }
 
 
 static struct sock *__udp6_lib_lookup(struct net *net,
 static struct sock *__udp6_lib_lookup(struct net *net,
-				      struct in6_addr *saddr, __be16 sport,
-				      struct in6_addr *daddr, __be16 dport,
+				      const struct in6_addr *saddr, __be16 sport,
+				      const struct in6_addr *daddr, __be16 dport,
 				      int dif, struct udp_table *udptable)
 				      int dif, struct udp_table *udptable)
 {
 {
 	struct sock *sk, *result;
 	struct sock *sk, *result;