Skip to content

Commit

Permalink
can: bcm: initialize ifindex for timeouts without previous frame rece…
Browse files Browse the repository at this point in the history
…ption

Set in the rx_ifindex to pass the correct interface index in the case of a
message timeout detection. Usually the rx_ifindex value is set at receive
time. But when no CAN frame has been received the RX_TIMEOUT notification
did not contain a valid value.

Cc: linux-stable <stable@vger.kernel.org>
Reported-by: Andre Naujoks <nautsch2@googlemail.com>
Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
  • Loading branch information
Oliver Hartkopp authored and Marc Kleine-Budde committed Nov 26, 2012
1 parent c9faaa0 commit 81b4011
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions net/can/bcm.c
Original file line number Diff line number Diff line change
Expand Up @@ -1084,6 +1084,9 @@ static int bcm_rx_setup(struct bcm_msg_head *msg_head, struct msghdr *msg,
op->sk = sk;
op->ifindex = ifindex;

/* ifindex for timeout events w/o previous frame reception */
op->rx_ifindex = ifindex;

/* initialize uninitialized (kzalloc) structure */
hrtimer_init(&op->timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
op->timer.function = bcm_rx_timeout_handler;
Expand Down

0 comments on commit 81b4011

Please sign in to comment.