Skip to content

Commit

Permalink
ipv4: raw: constify raw_v4_match() socket argument
Browse files Browse the repository at this point in the history
This clarifies raw_v4_match() intent.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Reviewed-by: Simon Horman <simon.horman@corigine.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Eric Dumazet authored and David S. Miller committed Mar 17, 2023
1 parent db6af4f commit 0a8c256
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion include/net/raw.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
extern struct proto raw_prot;

extern struct raw_hashinfo raw_v4_hashinfo;
bool raw_v4_match(struct net *net, struct sock *sk, unsigned short num,
bool raw_v4_match(struct net *net, const struct sock *sk, unsigned short num,
__be32 raddr, __be32 laddr, int dif, int sdif);

int raw_abort(struct sock *sk, int err);
Expand Down
4 changes: 2 additions & 2 deletions net/ipv4/raw.c
Original file line number Diff line number Diff line change
Expand Up @@ -116,10 +116,10 @@ void raw_unhash_sk(struct sock *sk)
}
EXPORT_SYMBOL_GPL(raw_unhash_sk);

bool raw_v4_match(struct net *net, struct sock *sk, unsigned short num,
bool raw_v4_match(struct net *net, const struct sock *sk, unsigned short num,
__be32 raddr, __be32 laddr, int dif, int sdif)
{
struct inet_sock *inet = inet_sk(sk);
const struct inet_sock *inet = inet_sk(sk);

if (net_eq(sock_net(sk), net) && inet->inet_num == num &&
!(inet->inet_daddr && inet->inet_daddr != raddr) &&
Expand Down

0 comments on commit 0a8c256

Please sign in to comment.