aboutsummaryrefslogtreecommitdiffstats
path: root/net/irda/irlap_frame.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/irda/irlap_frame.c')
-rw-r--r--net/irda/irlap_frame.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/net/irda/irlap_frame.c b/net/irda/irlap_frame.c
index 0b04603e9c47..3c5a68e36414 100644
--- a/net/irda/irlap_frame.c
+++ b/net/irda/irlap_frame.c
@@ -93,7 +93,9 @@ void irlap_queue_xmit(struct irlap_cb *self, struct sk_buff *skb)
93{ 93{
94 /* Some common init stuff */ 94 /* Some common init stuff */
95 skb->dev = self->netdev; 95 skb->dev = self->netdev;
96 skb->h.raw = skb->nh.raw = skb->mac.raw = skb->data; 96 skb_reset_mac_header(skb);
97 skb_reset_network_header(skb);
98 skb_reset_transport_header(skb);
97 skb->protocol = htons(ETH_P_IRDA); 99 skb->protocol = htons(ETH_P_IRDA);
98 skb->priority = TC_PRIO_BESTEFFORT; 100 skb->priority = TC_PRIO_BESTEFFORT;
99 101
@@ -411,7 +413,7 @@ static void irlap_recv_discovery_xid_rsp(struct irlap_cb *self,
411 IRDA_ASSERT(self->magic == LAP_MAGIC, return;); 413 IRDA_ASSERT(self->magic == LAP_MAGIC, return;);
412 414
413 if (!pskb_may_pull(skb, sizeof(struct xid_frame))) { 415 if (!pskb_may_pull(skb, sizeof(struct xid_frame))) {
414 IRDA_ERROR("%s: frame to short!\n", __FUNCTION__); 416 IRDA_ERROR("%s: frame too short!\n", __FUNCTION__);
415 return; 417 return;
416 } 418 }
417 419
@@ -482,7 +484,7 @@ static void irlap_recv_discovery_xid_cmd(struct irlap_cb *self,
482 char *text; 484 char *text;
483 485
484 if (!pskb_may_pull(skb, sizeof(struct xid_frame))) { 486 if (!pskb_may_pull(skb, sizeof(struct xid_frame))) {
485 IRDA_ERROR("%s: frame to short!\n", __FUNCTION__); 487 IRDA_ERROR("%s: frame too short!\n", __FUNCTION__);
486 return; 488 return;
487 } 489 }
488 490
@@ -526,7 +528,7 @@ static void irlap_recv_discovery_xid_cmd(struct irlap_cb *self,
526 /* Check if things are sane at this point... */ 528 /* Check if things are sane at this point... */
527 if((discovery_info == NULL) || 529 if((discovery_info == NULL) ||
528 !pskb_may_pull(skb, 3)) { 530 !pskb_may_pull(skb, 3)) {
529 IRDA_ERROR("%s: discovery frame to short!\n", 531 IRDA_ERROR("%s: discovery frame too short!\n",
530 __FUNCTION__); 532 __FUNCTION__);
531 return; 533 return;
532 } 534 }
@@ -1171,7 +1173,7 @@ static void irlap_recv_frmr_frame(struct irlap_cb *self, struct sk_buff *skb,
1171 IRDA_ASSERT(info != NULL, return;); 1173 IRDA_ASSERT(info != NULL, return;);
1172 1174
1173 if (!pskb_may_pull(skb, 4)) { 1175 if (!pskb_may_pull(skb, 4)) {
1174 IRDA_ERROR("%s: frame to short!\n", __FUNCTION__); 1176 IRDA_ERROR("%s: frame too short!\n", __FUNCTION__);
1175 return; 1177 return;
1176 } 1178 }
1177 1179
@@ -1260,7 +1262,7 @@ static void irlap_recv_test_frame(struct irlap_cb *self, struct sk_buff *skb,
1260 IRDA_DEBUG(2, "%s()\n", __FUNCTION__); 1262 IRDA_DEBUG(2, "%s()\n", __FUNCTION__);
1261 1263
1262 if (!pskb_may_pull(skb, sizeof(*frame))) { 1264 if (!pskb_may_pull(skb, sizeof(*frame))) {
1263 IRDA_ERROR("%s: frame to short!\n", __FUNCTION__); 1265 IRDA_ERROR("%s: frame too short!\n", __FUNCTION__);
1264 return; 1266 return;
1265 } 1267 }
1266 frame = (struct test_frame *) skb->data; 1268 frame = (struct test_frame *) skb->data;
@@ -1268,7 +1270,7 @@ static void irlap_recv_test_frame(struct irlap_cb *self, struct sk_buff *skb,
1268 /* Broadcast frames must carry saddr and daddr fields */ 1270 /* Broadcast frames must carry saddr and daddr fields */
1269 if (info->caddr == CBROADCAST) { 1271 if (info->caddr == CBROADCAST) {
1270 if (skb->len < sizeof(struct test_frame)) { 1272 if (skb->len < sizeof(struct test_frame)) {
1271 IRDA_DEBUG(0, "%s() test frame to short!\n", 1273 IRDA_DEBUG(0, "%s() test frame too short!\n",
1272 __FUNCTION__); 1274 __FUNCTION__);
1273 return; 1275 return;
1274 } 1276 }
@@ -1334,7 +1336,7 @@ int irlap_driver_rcv(struct sk_buff *skb, struct net_device *dev,
1334 1336
1335 /* Check if frame is large enough for parsing */ 1337 /* Check if frame is large enough for parsing */
1336 if (!pskb_may_pull(skb, 2)) { 1338 if (!pskb_may_pull(skb, 2)) {
1337 IRDA_ERROR("%s: frame to short!\n", __FUNCTION__); 1339 IRDA_ERROR("%s: frame too short!\n", __FUNCTION__);
1338 dev_kfree_skb(skb); 1340 dev_kfree_skb(skb);
1339 return -1; 1341 return -1;
1340 } 1342 }