Skip to contentSkip to conversation

can-bcm: initialize ifindex for timeouts without previous frame reception

PATCH In review Oliver Hartkopp 2 participants 4 messages Nov 26, 2012

Subsystems (2)
lore
Share & tools
lore

Oliver Hartkopp

author maintainer
#0 lore raw

PATCH 1/1 can-bcm: initialize ifindex for timeouts without previous frame reception

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.

---

net/can/bcm.c +3 -0
index 6f74758..969b7cd 100644
@@ -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;
#1 lore raw
Quoted 7 lines · Oliver Hartkopp

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.

Tnx, I'll send a pull request to David, let's hope the best :)

Marc

Signature · 4 lines
Pengutronix e.K.                  | Marc Kleine-Budde           |
Industrial Linux Solutions        | Phone: +49-231-2826-924     |
Vertretung West/Dortmund          | Fax:   +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686  | http://www.pengutronix.de   |
author maintainer
#2 lore raw
Quoted 10 lines · Marc Kleine-Budde
Quoted 7 lines · Oliver Hartkopp

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.

Tnx, I'll send a pull request to David, let's hope the best :)

It probably helps to tag this patch as a candidate for stable also.

BR,
Oliver

#3 lore raw
Quoted 8 lines · Oliver Hartkopp
Quoted 6 lines · Marc Kleine-Budde
Quoted 5 lines · Oliver Hartkopp

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.

Quoted 7 lines
Quoted 4 lines
Quoted 2 lines

Tnx, I'll send a pull request to David, let's hope the best :)

It probably helps to tag this patch as a candidate for stable also.

Tnx, already did :)

https://gitorious.org/linux-can/linux-can/commits/fixes-for-3.7

Marc

Signature · 4 lines
Pengutronix e.K.                  | Marc Kleine-Budde           |
Industrial Linux Solutions        | Phone: +49-231-2826-924     |
Vertretung West/Dortmund          | Fax:   +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686  | http://www.pengutronix.de   |