All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] can-bcm: initialize ifindex for timeouts without previous frame reception
@ 2012-11-26 21:24 Oliver Hartkopp
  2012-11-26 21:37 ` Marc Kleine-Budde
  0 siblings, 1 reply; 4+ messages in thread
From: Oliver Hartkopp @ 2012-11-26 21:24 UTC (permalink / raw)
  To: Marc Kleine-Budde; +Cc: linux-can@vger.kernel.org, Andre Naujoks

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.

Reported-by: Andre Naujoks <nautsch2@googlemail.com>
Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>

---

diff --git a/net/can/bcm.c b/net/can/bcm.c
index 6f74758..969b7cd 100644
--- a/net/can/bcm.c
+++ b/net/can/bcm.c
@@ -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;


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-11-26 21:42 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-11-26 21:24 [PATCH] can-bcm: initialize ifindex for timeouts without previous frame reception Oliver Hartkopp
2012-11-26 21:37 ` Marc Kleine-Budde
2012-11-26 21:39   ` Oliver Hartkopp
2012-11-26 21:42     ` Marc Kleine-Budde

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.