summaryrefslogtreecommitdiffstats
path: root/net/irda/irlap_frame.c
diff options
context:
space:
mode:
authorG. Liakhovetski <gl@dsa-ac.de>2007-06-08 19:15:17 -0700
committerDavid S. Miller <davem@davemloft.net>2007-06-08 19:15:17 -0700
commitc0cfe7faa12f189ef1024fce5a710791d0062355 (patch)
treee3f6e22de451d8d679235f8adea313a25c5de497 /net/irda/irlap_frame.c
parent81d84a94be8085475c3585596e52b06ccbedd922 (diff)
downloadblackbird-op-linux-c0cfe7faa12f189ef1024fce5a710791d0062355.tar.gz
blackbird-op-linux-c0cfe7faa12f189ef1024fce5a710791d0062355.zip
[IrDA]: Fix Rx/Tx path race.
From: G. Liakhovetski <gl@dsa-ac.de> We need to switch to NRM _before_ sending the final packet otherwise we might hit a race condition where we get the first packet from the peer while we're still in LAP_XMIT_P. Signed-off-by: Samuel Ortiz <samuel@sortiz.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/irda/irlap_frame.c')
-rw-r--r--net/irda/irlap_frame.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/net/irda/irlap_frame.c b/net/irda/irlap_frame.c
index 3c5a68e36414..3013c49ab975 100644
--- a/net/irda/irlap_frame.c
+++ b/net/irda/irlap_frame.c
@@ -798,16 +798,19 @@ void irlap_send_data_primary_poll(struct irlap_cb *self, struct sk_buff *skb)
self->vs = (self->vs + 1) % 8;
self->ack_required = FALSE;
+ irlap_next_state(self, LAP_NRM_P);
irlap_send_i_frame(self, tx_skb, CMD_FRAME);
} else {
IRDA_DEBUG(4, "%s(), sending unreliable frame\n", __FUNCTION__);
if (self->ack_required) {
irlap_send_ui_frame(self, skb_get(skb), self->caddr, CMD_FRAME);
+ irlap_next_state(self, LAP_NRM_P);
irlap_send_rr_frame(self, CMD_FRAME);
self->ack_required = FALSE;
} else {
skb->data[1] |= PF_BIT;
+ irlap_next_state(self, LAP_NRM_P);
irlap_send_ui_frame(self, skb_get(skb), self->caddr, CMD_FRAME);
}
}
OpenPOWER on IntegriCloud