diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-11-12 20:17:55 -0500 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-11-12 20:17:55 -0500 |
| commit | 9457b24a0955bbdd2e89220a75de69fe09501bba (patch) | |
| tree | cb484848e14cc2705c4513ad3ec1f0420a4d55db /include/linux | |
| parent | 80ef913f5e6a84551545016cea709f5e96d0cda6 (diff) | |
| parent | 0597d1b99fcfc2c0eada09a698f85ed413d4ba84 (diff) | |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6: (66 commits)
can-bcm: fix minor heap overflow
gianfar: Do not call device_set_wakeup_enable() under a spinlock
ipv6: Warn users if maximum number of routes is reached.
docs: Add neigh/gc_thresh3 and route/max_size documentation.
axnet_cs: fix resume problem for some Ax88790 chip
ipv6: addrconf: don't remove address state on ifdown if the address is being kept
tcp: Don't change unlocked socket state in tcp_v4_err().
x25: Prevent crashing when parsing bad X.25 facilities
cxgb4vf: add call to Firmware to reset VF State.
cxgb4vf: Fail open if link_start() fails.
cxgb4vf: flesh out PCI Device ID Table ...
cxgb4vf: fix some errors in Gather List to skb conversion
cxgb4vf: fix bug in Generic Receive Offload
cxgb4vf: don't implement trivial (and incorrect) ndo_select_queue()
ixgbe: Look inside vlan when determining offload protocol.
bnx2x: Look inside vlan when determining checksum proto.
vlan: Add function to retrieve EtherType from vlan packets.
virtio-net: init link state correctly
ucc_geth: Fix deadlock
ucc_geth: Do not bring the whole IF down when TX failure.
...
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/if_vlan.h | 25 | ||||
| -rw-r--r-- | include/linux/netdevice.h | 5 | ||||
| -rw-r--r-- | include/linux/netfilter.h | 2 |
3 files changed, 31 insertions, 1 deletions
diff --git a/include/linux/if_vlan.h b/include/linux/if_vlan.h index c2f3a72712ce..635e1faec412 100644 --- a/include/linux/if_vlan.h +++ b/include/linux/if_vlan.h | |||
| @@ -339,6 +339,31 @@ static inline int vlan_get_tag(const struct sk_buff *skb, u16 *vlan_tci) | |||
| 339 | } | 339 | } |
| 340 | } | 340 | } |
| 341 | 341 | ||
| 342 | /** | ||
| 343 | * vlan_get_protocol - get protocol EtherType. | ||
| 344 | * @skb: skbuff to query | ||
| 345 | * | ||
| 346 | * Returns the EtherType of the packet, regardless of whether it is | ||
| 347 | * vlan encapsulated (normal or hardware accelerated) or not. | ||
| 348 | */ | ||
| 349 | static inline __be16 vlan_get_protocol(const struct sk_buff *skb) | ||
| 350 | { | ||
| 351 | __be16 protocol = 0; | ||
| 352 | |||
| 353 | if (vlan_tx_tag_present(skb) || | ||
| 354 | skb->protocol != cpu_to_be16(ETH_P_8021Q)) | ||
| 355 | protocol = skb->protocol; | ||
| 356 | else { | ||
| 357 | __be16 proto, *protop; | ||
| 358 | protop = skb_header_pointer(skb, offsetof(struct vlan_ethhdr, | ||
| 359 | h_vlan_encapsulated_proto), | ||
| 360 | sizeof(proto), &proto); | ||
| 361 | if (likely(protop)) | ||
| 362 | protocol = *protop; | ||
| 363 | } | ||
| 364 | |||
| 365 | return protocol; | ||
| 366 | } | ||
| 342 | #endif /* __KERNEL__ */ | 367 | #endif /* __KERNEL__ */ |
| 343 | 368 | ||
| 344 | /* VLAN IOCTLs are found in sockios.h */ | 369 | /* VLAN IOCTLs are found in sockios.h */ |
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index 072652d94d9f..d8fd2c23a1b9 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h | |||
| @@ -1554,6 +1554,11 @@ static inline void netif_tx_wake_all_queues(struct net_device *dev) | |||
| 1554 | 1554 | ||
| 1555 | static inline void netif_tx_stop_queue(struct netdev_queue *dev_queue) | 1555 | static inline void netif_tx_stop_queue(struct netdev_queue *dev_queue) |
| 1556 | { | 1556 | { |
| 1557 | if (WARN_ON(!dev_queue)) { | ||
| 1558 | printk(KERN_INFO "netif_stop_queue() cannot be called before " | ||
| 1559 | "register_netdev()"); | ||
| 1560 | return; | ||
| 1561 | } | ||
| 1557 | set_bit(__QUEUE_STATE_XOFF, &dev_queue->state); | 1562 | set_bit(__QUEUE_STATE_XOFF, &dev_queue->state); |
| 1558 | } | 1563 | } |
| 1559 | 1564 | ||
diff --git a/include/linux/netfilter.h b/include/linux/netfilter.h index 89341c32631a..03317c8d4077 100644 --- a/include/linux/netfilter.h +++ b/include/linux/netfilter.h | |||
| @@ -215,7 +215,7 @@ NF_HOOK_COND(uint8_t pf, unsigned int hook, struct sk_buff *skb, | |||
| 215 | int ret; | 215 | int ret; |
| 216 | 216 | ||
| 217 | if (!cond || | 217 | if (!cond || |
| 218 | (ret = nf_hook_thresh(pf, hook, skb, in, out, okfn, INT_MIN) == 1)) | 218 | ((ret = nf_hook_thresh(pf, hook, skb, in, out, okfn, INT_MIN)) == 1)) |
| 219 | ret = okfn(skb); | 219 | ret = okfn(skb); |
| 220 | return ret; | 220 | return ret; |
| 221 | } | 221 | } |
