diff options
| author | Alexander Aring <alex.aring@gmail.com> | 2015-10-13 07:42:59 -0400 |
|---|---|---|
| committer | Marcel Holtmann <marcel@holtmann.org> | 2015-10-20 18:49:25 -0400 |
| commit | 478208e3b9988adc7ec2c480f237049aaf7c4609 (patch) | |
| tree | a8b546a42284a369063a295f73b2a1bc642dad55 | |
| parent | 8911d7748ca360ef96cb207cc5165eb9c08669e5 (diff) | |
6lowpan: remove lowpan_fetch_skb_u8
This patch removes the lowpan_fetch_skb_u8 function for getting the iphc
bytes. Instead we using the generic which has a len parameter to tell
the amount of bytes to fetch.
Signed-off-by: Alexander Aring <alex.aring@gmail.com>
Acked-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
| -rw-r--r-- | include/net/6lowpan.h | 27 | ||||
| -rw-r--r-- | net/6lowpan/iphc.c | 4 |
2 files changed, 16 insertions, 15 deletions
diff --git a/include/net/6lowpan.h b/include/net/6lowpan.h index ac30ad3d8cd3..4afdbb3ab6d8 100644 --- a/include/net/6lowpan.h +++ b/include/net/6lowpan.h | |||
| @@ -287,19 +287,20 @@ static inline void raw_dump_inline(const char *caller, char *msg, | |||
| 287 | const unsigned char *buf, int len) { } | 287 | const unsigned char *buf, int len) { } |
| 288 | #endif | 288 | #endif |
| 289 | 289 | ||
| 290 | static inline int lowpan_fetch_skb_u8(struct sk_buff *skb, u8 *val) | 290 | /** |
| 291 | { | 291 | * lowpan_fetch_skb - getting inline data from 6LoWPAN header |
| 292 | if (unlikely(!pskb_may_pull(skb, 1))) | 292 | * |
| 293 | return -EINVAL; | 293 | * This function will pull data from sk buffer and put it into data to |
| 294 | 294 | * remove the 6LoWPAN inline data. This function returns true if the | |
| 295 | *val = skb->data[0]; | 295 | * sk buffer is too small to pull the amount of data which is specified |
| 296 | skb_pull(skb, 1); | 296 | * by len. |
| 297 | 297 | * | |
| 298 | return 0; | 298 | * @skb: the buffer where the inline data should be pulled from. |
| 299 | } | 299 | * @data: destination buffer for the inline data. |
| 300 | 300 | * @len: amount of data which should be pulled in bytes. | |
| 301 | static inline bool lowpan_fetch_skb(struct sk_buff *skb, | 301 | */ |
| 302 | void *data, const unsigned int len) | 302 | static inline bool lowpan_fetch_skb(struct sk_buff *skb, void *data, |
| 303 | unsigned int len) | ||
| 303 | { | 304 | { |
| 304 | if (unlikely(!pskb_may_pull(skb, len))) | 305 | if (unlikely(!pskb_may_pull(skb, len))) |
| 305 | return true; | 306 | return true; |
diff --git a/net/6lowpan/iphc.c b/net/6lowpan/iphc.c index 8f967d3b494e..87d8f1fe7a4a 100644 --- a/net/6lowpan/iphc.c +++ b/net/6lowpan/iphc.c | |||
| @@ -265,8 +265,8 @@ int lowpan_header_decompress(struct sk_buff *skb, const struct net_device *dev, | |||
| 265 | raw_dump_table(__func__, "raw skb data dump uncompressed", | 265 | raw_dump_table(__func__, "raw skb data dump uncompressed", |
| 266 | skb->data, skb->len); | 266 | skb->data, skb->len); |
| 267 | 267 | ||
| 268 | if (lowpan_fetch_skb_u8(skb, &iphc0) || | 268 | if (lowpan_fetch_skb(skb, &iphc0, sizeof(iphc0)) || |
| 269 | lowpan_fetch_skb_u8(skb, &iphc1)) | 269 | lowpan_fetch_skb(skb, &iphc1, sizeof(iphc1))) |
| 270 | return -EINVAL; | 270 | return -EINVAL; |
| 271 | 271 | ||
| 272 | /* another if the CID flag is set */ | 272 | /* another if the CID flag is set */ |
