diff options
author | Alexander Aring <alex.aring@gmail.com> | 2014-07-29 17:47:00 -0400 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2014-07-30 13:28:39 -0400 |
commit | 4ebc960f9453d2610d150bef4fc9ca227bd33e22 (patch) | |
tree | dbe9e440211a8d9440af7f36a13f8425e371e35e /net/6lowpan | |
parent | 8ec1d9be323388550b3eb4390c23217ea0711013 (diff) |
6lowpan: iphc: cleanup use of lowpan_fetch_skb
We introduced the lowpan_fetch_skb function in some previous patches for
6lowpan to have a generic fetch function. This patch drops the old
function and use the generic lowpan_fetch_skb one.
Signed-off-by: Alexander Aring <alex.aring@gmail.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'net/6lowpan')
-rw-r--r-- | net/6lowpan/iphc.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/net/6lowpan/iphc.c b/net/6lowpan/iphc.c index d2654d46e0c1..0376684f28d0 100644 --- a/net/6lowpan/iphc.c +++ b/net/6lowpan/iphc.c | |||
@@ -357,7 +357,7 @@ int lowpan_process_data(struct sk_buff *skb, struct net_device *dev, | |||
357 | /* another if the CID flag is set */ | 357 | /* another if the CID flag is set */ |
358 | if (iphc1 & LOWPAN_IPHC_CID) { | 358 | if (iphc1 & LOWPAN_IPHC_CID) { |
359 | pr_debug("CID flag is set, increase header with one\n"); | 359 | pr_debug("CID flag is set, increase header with one\n"); |
360 | if (lowpan_fetch_skb_u8(skb, &num_context)) | 360 | if (lowpan_fetch_skb(skb, &num_context, sizeof(num_context))) |
361 | goto drop; | 361 | goto drop; |
362 | } | 362 | } |
363 | 363 | ||
@@ -370,7 +370,7 @@ int lowpan_process_data(struct sk_buff *skb, struct net_device *dev, | |||
370 | * ECN + DSCP + 4-bit Pad + Flow Label (4 bytes) | 370 | * ECN + DSCP + 4-bit Pad + Flow Label (4 bytes) |
371 | */ | 371 | */ |
372 | case 0: /* 00b */ | 372 | case 0: /* 00b */ |
373 | if (lowpan_fetch_skb_u8(skb, &tmp)) | 373 | if (lowpan_fetch_skb(skb, &tmp, sizeof(tmp))) |
374 | goto drop; | 374 | goto drop; |
375 | 375 | ||
376 | memcpy(&hdr.flow_lbl, &skb->data[0], 3); | 376 | memcpy(&hdr.flow_lbl, &skb->data[0], 3); |
@@ -384,7 +384,7 @@ int lowpan_process_data(struct sk_buff *skb, struct net_device *dev, | |||
384 | * ECN + DSCP (1 byte), Flow Label is elided | 384 | * ECN + DSCP (1 byte), Flow Label is elided |
385 | */ | 385 | */ |
386 | case 2: /* 10b */ | 386 | case 2: /* 10b */ |
387 | if (lowpan_fetch_skb_u8(skb, &tmp)) | 387 | if (lowpan_fetch_skb(skb, &tmp, sizeof(tmp))) |
388 | goto drop; | 388 | goto drop; |
389 | 389 | ||
390 | hdr.priority = ((tmp >> 2) & 0x0f); | 390 | hdr.priority = ((tmp >> 2) & 0x0f); |
@@ -395,7 +395,7 @@ int lowpan_process_data(struct sk_buff *skb, struct net_device *dev, | |||
395 | * ECN + 2-bit Pad + Flow Label (3 bytes), DSCP is elided | 395 | * ECN + 2-bit Pad + Flow Label (3 bytes), DSCP is elided |
396 | */ | 396 | */ |
397 | case 1: /* 01b */ | 397 | case 1: /* 01b */ |
398 | if (lowpan_fetch_skb_u8(skb, &tmp)) | 398 | if (lowpan_fetch_skb(skb, &tmp, sizeof(tmp))) |
399 | goto drop; | 399 | goto drop; |
400 | 400 | ||
401 | hdr.flow_lbl[0] = (skb->data[0] & 0x0F) | ((tmp >> 2) & 0x30); | 401 | hdr.flow_lbl[0] = (skb->data[0] & 0x0F) | ((tmp >> 2) & 0x30); |
@@ -412,7 +412,7 @@ int lowpan_process_data(struct sk_buff *skb, struct net_device *dev, | |||
412 | /* Next Header */ | 412 | /* Next Header */ |
413 | if ((iphc0 & LOWPAN_IPHC_NH_C) == 0) { | 413 | if ((iphc0 & LOWPAN_IPHC_NH_C) == 0) { |
414 | /* Next header is carried inline */ | 414 | /* Next header is carried inline */ |
415 | if (lowpan_fetch_skb_u8(skb, &(hdr.nexthdr))) | 415 | if (lowpan_fetch_skb(skb, &hdr.nexthdr, sizeof(hdr.nexthdr))) |
416 | goto drop; | 416 | goto drop; |
417 | 417 | ||
418 | pr_debug("NH flag is set, next header carried inline: %02x\n", | 418 | pr_debug("NH flag is set, next header carried inline: %02x\n", |
@@ -423,7 +423,8 @@ int lowpan_process_data(struct sk_buff *skb, struct net_device *dev, | |||
423 | if ((iphc0 & 0x03) != LOWPAN_IPHC_TTL_I) | 423 | if ((iphc0 & 0x03) != LOWPAN_IPHC_TTL_I) |
424 | hdr.hop_limit = lowpan_ttl_values[iphc0 & 0x03]; | 424 | hdr.hop_limit = lowpan_ttl_values[iphc0 & 0x03]; |
425 | else { | 425 | else { |
426 | if (lowpan_fetch_skb_u8(skb, &(hdr.hop_limit))) | 426 | if (lowpan_fetch_skb(skb, &hdr.hop_limit, |
427 | sizeof(hdr.hop_limit))) | ||
427 | goto drop; | 428 | goto drop; |
428 | } | 429 | } |
429 | 430 | ||