Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ipv4: Constify the sk parameter of ip_route_output_*().

These functions don't need to modify the socket, so let's allow the
callers to pass a const struct sock *.

Signed-off-by: Guillaume Nault <gnault@redhat.com>
Reviewed-by: Simon Horman <simon.horman@corigine.com>
Reviewed-by: David Ahern <dsahern@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Guillaume Nault and committed by
David S. Miller
8d6eba33 5b52ad34

+3 -3
+3 -3
include/net/route.h
··· 163 163 } 164 164 165 165 static inline struct rtable *ip_route_output_ports(struct net *net, struct flowi4 *fl4, 166 - struct sock *sk, 166 + const struct sock *sk, 167 167 __be32 daddr, __be32 saddr, 168 168 __be16 dport, __be16 sport, 169 169 __u8 proto, __u8 tos, int oif) ··· 309 309 static inline struct rtable *ip_route_connect(struct flowi4 *fl4, __be32 dst, 310 310 __be32 src, int oif, u8 protocol, 311 311 __be16 sport, __be16 dport, 312 - struct sock *sk) 312 + const struct sock *sk) 313 313 { 314 314 struct net *net = sock_net(sk); 315 315 struct rtable *rt; ··· 330 330 static inline struct rtable *ip_route_newports(struct flowi4 *fl4, struct rtable *rt, 331 331 __be16 orig_sport, __be16 orig_dport, 332 332 __be16 sport, __be16 dport, 333 - struct sock *sk) 333 + const struct sock *sk) 334 334 { 335 335 if (sport != orig_sport || dport != orig_dport) { 336 336 fl4->fl4_dport = dport;