Skip to content

Commit

Permalink
isotp: support 3.16 LTS kernel in version guard
Browse files Browse the repository at this point in the history
can_rx_register() was changed in 4.10(-rc7), backported to 4.9.11, but
also to 4.4 LTS in 4.4.50 and 3.18 LTS in 3.18.49 and 3.16 LTS in 3.16.42.

The kernel guard therefore needs to check various version ranges.

#14

Reported-by: https://github.com/MaterFertex
Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
  • Loading branch information
hartkopp committed May 24, 2019
1 parent eec0f7e commit ae90829
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion net/can/isotp.c
Original file line number Diff line number Diff line change
Expand Up @@ -1143,7 +1143,8 @@ static int isotp_bind(struct socket *sock, struct sockaddr *uaddr, int len)
SINGLE_MASK(addr->can_addr.tp.rx_id), isotp_rcv, sk,
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,9,11)) || \
((LINUX_VERSION_CODE >= KERNEL_VERSION(4,4,50)) && (LINUX_VERSION_CODE < KERNEL_VERSION(4, 5, 0))) || \
((LINUX_VERSION_CODE >= KERNEL_VERSION(3,18,49)) && (LINUX_VERSION_CODE < KERNEL_VERSION(3, 19, 0)))
((LINUX_VERSION_CODE >= KERNEL_VERSION(3,18,49)) && (LINUX_VERSION_CODE < KERNEL_VERSION(3, 19, 0))) || \
((LINUX_VERSION_CODE >= KERNEL_VERSION(3,16,42)) && (LINUX_VERSION_CODE < KERNEL_VERSION(3, 17, 0)))
"isotp", sk);
#else
"isotp");
Expand Down

0 comments on commit ae90829

Please sign in to comment.