Commit 8d6eba33 authored by Guillaume Nault's avatar Guillaume Nault Committed by David S. Miller

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: default avatarGuillaume Nault <gnault@redhat.com>
Reviewed-by: default avatarSimon Horman <simon.horman@corigine.com>
Reviewed-by: default avatarDavid Ahern <dsahern@kernel.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 5b52ad34
...@@ -163,7 +163,7 @@ static inline struct rtable *ip_route_output(struct net *net, __be32 daddr, ...@@ -163,7 +163,7 @@ static inline struct rtable *ip_route_output(struct net *net, __be32 daddr,
} }
static inline struct rtable *ip_route_output_ports(struct net *net, struct flowi4 *fl4, static inline struct rtable *ip_route_output_ports(struct net *net, struct flowi4 *fl4,
struct sock *sk, const struct sock *sk,
__be32 daddr, __be32 saddr, __be32 daddr, __be32 saddr,
__be16 dport, __be16 sport, __be16 dport, __be16 sport,
__u8 proto, __u8 tos, int oif) __u8 proto, __u8 tos, int oif)
...@@ -309,7 +309,7 @@ static inline void ip_route_connect_init(struct flowi4 *fl4, __be32 dst, ...@@ -309,7 +309,7 @@ static inline void ip_route_connect_init(struct flowi4 *fl4, __be32 dst,
static inline struct rtable *ip_route_connect(struct flowi4 *fl4, __be32 dst, static inline struct rtable *ip_route_connect(struct flowi4 *fl4, __be32 dst,
__be32 src, int oif, u8 protocol, __be32 src, int oif, u8 protocol,
__be16 sport, __be16 dport, __be16 sport, __be16 dport,
struct sock *sk) const struct sock *sk)
{ {
struct net *net = sock_net(sk); struct net *net = sock_net(sk);
struct rtable *rt; struct rtable *rt;
...@@ -330,7 +330,7 @@ static inline struct rtable *ip_route_connect(struct flowi4 *fl4, __be32 dst, ...@@ -330,7 +330,7 @@ static inline struct rtable *ip_route_connect(struct flowi4 *fl4, __be32 dst,
static inline struct rtable *ip_route_newports(struct flowi4 *fl4, struct rtable *rt, static inline struct rtable *ip_route_newports(struct flowi4 *fl4, struct rtable *rt,
__be16 orig_sport, __be16 orig_dport, __be16 orig_sport, __be16 orig_dport,
__be16 sport, __be16 dport, __be16 sport, __be16 dport,
struct sock *sk) const struct sock *sk)
{ {
if (sport != orig_sport || dport != orig_dport) { if (sport != orig_sport || dport != orig_dport) {
fl4->fl4_dport = dport; fl4->fl4_dport = dport;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment