diff options
Diffstat (limited to 'include/linux/skbuff.h')
| -rw-r--r-- | include/linux/skbuff.h | 57 |
1 files changed, 49 insertions, 8 deletions
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index 4286d832166f..83010231db99 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h | |||
| @@ -274,6 +274,9 @@ struct sk_buff { | |||
| 274 | #if defined(CONFIG_IP_VS) || defined(CONFIG_IP_VS_MODULE) | 274 | #if defined(CONFIG_IP_VS) || defined(CONFIG_IP_VS_MODULE) |
| 275 | __u8 ipvs_property:1; | 275 | __u8 ipvs_property:1; |
| 276 | #endif | 276 | #endif |
| 277 | #if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE) | ||
| 278 | struct sk_buff *nfct_reasm; | ||
| 279 | #endif | ||
| 277 | #ifdef CONFIG_BRIDGE_NETFILTER | 280 | #ifdef CONFIG_BRIDGE_NETFILTER |
| 278 | struct nf_bridge_info *nf_bridge; | 281 | struct nf_bridge_info *nf_bridge; |
| 279 | #endif | 282 | #endif |
| @@ -603,23 +606,23 @@ static inline void skb_queue_head_init(struct sk_buff_head *list) | |||
| 603 | */ | 606 | */ |
| 604 | 607 | ||
| 605 | /** | 608 | /** |
| 606 | * __skb_queue_head - queue a buffer at the list head | 609 | * __skb_queue_after - queue a buffer at the list head |
| 607 | * @list: list to use | 610 | * @list: list to use |
| 611 | * @prev: place after this buffer | ||
| 608 | * @newsk: buffer to queue | 612 | * @newsk: buffer to queue |
| 609 | * | 613 | * |
| 610 | * Queue a buffer at the start of a list. This function takes no locks | 614 | * Queue a buffer int the middle of a list. This function takes no locks |
| 611 | * and you must therefore hold required locks before calling it. | 615 | * and you must therefore hold required locks before calling it. |
| 612 | * | 616 | * |
| 613 | * A buffer cannot be placed on two lists at the same time. | 617 | * A buffer cannot be placed on two lists at the same time. |
| 614 | */ | 618 | */ |
| 615 | extern void skb_queue_head(struct sk_buff_head *list, struct sk_buff *newsk); | 619 | static inline void __skb_queue_after(struct sk_buff_head *list, |
| 616 | static inline void __skb_queue_head(struct sk_buff_head *list, | 620 | struct sk_buff *prev, |
| 617 | struct sk_buff *newsk) | 621 | struct sk_buff *newsk) |
| 618 | { | 622 | { |
| 619 | struct sk_buff *prev, *next; | 623 | struct sk_buff *next; |
| 620 | |||
| 621 | list->qlen++; | 624 | list->qlen++; |
| 622 | prev = (struct sk_buff *)list; | 625 | |
| 623 | next = prev->next; | 626 | next = prev->next; |
| 624 | newsk->next = next; | 627 | newsk->next = next; |
| 625 | newsk->prev = prev; | 628 | newsk->prev = prev; |
| @@ -627,6 +630,23 @@ static inline void __skb_queue_head(struct sk_buff_head *list, | |||
| 627 | } | 630 | } |
| 628 | 631 | ||
| 629 | /** | 632 | /** |
| 633 | * __skb_queue_head - queue a buffer at the list head | ||
| 634 | * @list: list to use | ||
| 635 | * @newsk: buffer to queue | ||
| 636 | * | ||
| 637 | * Queue a buffer at the start of a list. This function takes no locks | ||
| 638 | * and you must therefore hold required locks before calling it. | ||
| 639 | * | ||
| 640 | * A buffer cannot be placed on two lists at the same time. | ||
| 641 | */ | ||
| 642 | extern void skb_queue_head(struct sk_buff_head *list, struct sk_buff *newsk); | ||
| 643 | static inline void __skb_queue_head(struct sk_buff_head *list, | ||
| 644 | struct sk_buff *newsk) | ||
| 645 | { | ||
| 646 | __skb_queue_after(list, (struct sk_buff *)list, newsk); | ||
| 647 | } | ||
| 648 | |||
| 649 | /** | ||
| 630 | * __skb_queue_tail - queue a buffer at the list tail | 650 | * __skb_queue_tail - queue a buffer at the list tail |
| 631 | * @list: list to use | 651 | * @list: list to use |
| 632 | * @newsk: buffer to queue | 652 | * @newsk: buffer to queue |
| @@ -1203,6 +1223,11 @@ static inline void kunmap_skb_frag(void *vaddr) | |||
| 1203 | prefetch(skb->next), (skb != (struct sk_buff *)(queue)); \ | 1223 | prefetch(skb->next), (skb != (struct sk_buff *)(queue)); \ |
| 1204 | skb = skb->next) | 1224 | skb = skb->next) |
| 1205 | 1225 | ||
| 1226 | #define skb_queue_reverse_walk(queue, skb) \ | ||
| 1227 | for (skb = (queue)->prev; \ | ||
| 1228 | prefetch(skb->prev), (skb != (struct sk_buff *)(queue)); \ | ||
| 1229 | skb = skb->prev) | ||
| 1230 | |||
| 1206 | 1231 | ||
| 1207 | extern struct sk_buff *skb_recv_datagram(struct sock *sk, unsigned flags, | 1232 | extern struct sk_buff *skb_recv_datagram(struct sock *sk, unsigned flags, |
| 1208 | int noblock, int *err); | 1233 | int noblock, int *err); |
| @@ -1291,10 +1316,26 @@ static inline void nf_conntrack_get(struct nf_conntrack *nfct) | |||
| 1291 | if (nfct) | 1316 | if (nfct) |
| 1292 | atomic_inc(&nfct->use); | 1317 | atomic_inc(&nfct->use); |
| 1293 | } | 1318 | } |
| 1319 | #if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE) | ||
| 1320 | static inline void nf_conntrack_get_reasm(struct sk_buff *skb) | ||
| 1321 | { | ||
| 1322 | if (skb) | ||
| 1323 | atomic_inc(&skb->users); | ||
| 1324 | } | ||
| 1325 | static inline void nf_conntrack_put_reasm(struct sk_buff *skb) | ||
| 1326 | { | ||
| 1327 | if (skb) | ||
| 1328 | kfree_skb(skb); | ||
| 1329 | } | ||
| 1330 | #endif | ||
| 1294 | static inline void nf_reset(struct sk_buff *skb) | 1331 | static inline void nf_reset(struct sk_buff *skb) |
| 1295 | { | 1332 | { |
| 1296 | nf_conntrack_put(skb->nfct); | 1333 | nf_conntrack_put(skb->nfct); |
| 1297 | skb->nfct = NULL; | 1334 | skb->nfct = NULL; |
| 1335 | #if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE) | ||
| 1336 | nf_conntrack_put_reasm(skb->nfct_reasm); | ||
| 1337 | skb->nfct_reasm = NULL; | ||
| 1338 | #endif | ||
| 1298 | } | 1339 | } |
| 1299 | 1340 | ||
| 1300 | #ifdef CONFIG_BRIDGE_NETFILTER | 1341 | #ifdef CONFIG_BRIDGE_NETFILTER |
