Skip to content

Commit

Permalink
can-isotp: use private ioctl function after changed SIOCGSTAMP handling
Browse files Browse the repository at this point in the history
commit c7cbdbf29f488a ("net: rework SIOCGSTAMP ioctl handling") moved the
timestamp handling into net/socket.c.

Always return -ENOIOCTLCMD to be able to forward ioctl commands like
SIOCGIFINDEX to the network driver layer.

See: 473d924d7d46 ("can: fix ioctl function removal")

Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
  • Loading branch information
hartkopp committed Jul 31, 2019
1 parent 7c03198 commit ff85005
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion net/can/isotp.c
Original file line number Diff line number Diff line change
Expand Up @@ -1461,6 +1461,13 @@ static int isotp_init(struct sock *sk)
return 0;
}

int isotp_sock_no_ioctlcmd(struct socket *sock, unsigned int cmd,
unsigned long arg)
{
/* no ioctls for socket layer -> hand it down to NIC layer */
return -ENOIOCTLCMD;
}

static const struct proto_ops isotp_ops = {
.family = PF_CAN,
.release = isotp_release,
Expand All @@ -1470,9 +1477,12 @@ static const struct proto_ops isotp_ops = {
.accept = sock_no_accept,
.getname = isotp_getname,
.poll = datagram_poll,
.ioctl = can_ioctl, /* use can_ioctl() from af_can.c */

#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,2,0)
.ioctl = isotp_sock_no_ioctlcmd,
.gettstamp = sock_gettstamp,
#else
.ioctl = can_ioctl, /* use can_ioctl() from af_can.c */
#endif
.listen = sock_no_listen,
.shutdown = sock_no_shutdown,
Expand Down

0 comments on commit ff85005

Please sign in to comment.