Skip to content

Commit

Permalink
net: constify sock_diag_check_cookie()
Browse files Browse the repository at this point in the history
sock_diag_check_cookie() second parameter is constant

Signed-off-by: Eric Dumazet <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
Eric Dumazet authored and davem330 committed Mar 10, 2015
1 parent 3855634 commit 491da2a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion include/linux/sock_diag.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ void sock_diag_unregister(const struct sock_diag_handler *h);
void sock_diag_register_inet_compat(int (*fn)(struct sk_buff *skb, struct nlmsghdr *nlh));
void sock_diag_unregister_inet_compat(int (*fn)(struct sk_buff *skb, struct nlmsghdr *nlh));

int sock_diag_check_cookie(void *sk, __u32 *cookie);
int sock_diag_check_cookie(void *sk, const __u32 *cookie);
void sock_diag_save_cookie(void *sk, __u32 *cookie);

int sock_diag_put_meminfo(struct sock *sk, struct sk_buff *skb, int attr);
Expand Down
2 changes: 1 addition & 1 deletion net/core/sock_diag.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ static const struct sock_diag_handler *sock_diag_handlers[AF_MAX];
static int (*inet_rcv_compat)(struct sk_buff *skb, struct nlmsghdr *nlh);
static DEFINE_MUTEX(sock_diag_table_mutex);

int sock_diag_check_cookie(void *sk, __u32 *cookie)
int sock_diag_check_cookie(void *sk, const __u32 *cookie)
{
if ((cookie[0] != INET_DIAG_NOCOOKIE ||
cookie[1] != INET_DIAG_NOCOOKIE) &&
Expand Down

0 comments on commit 491da2a

Please sign in to comment.