diff options
author | Ralf Baechle <ralf@linux-mips.org> | 2000-03-02 02:36:47 +0000 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2000-03-02 02:36:47 +0000 |
commit | 8624512aa908741ba2795200133eae0d7f4557ea (patch) | |
tree | d5d3036fccf2604f4c98dedc11e8adb929d6b52e /net/core | |
parent | 7b8f5d6f1d45d9f9de1d26e7d3c32aa5af11b488 (diff) |
Merge with 2.3.48.
Diffstat (limited to 'net/core')
-rw-r--r-- | net/core/dev.c | 41 |
1 files changed, 26 insertions, 15 deletions
diff --git a/net/core/dev.c b/net/core/dev.c index d2ed4f523..638ab6432 100644 --- a/net/core/dev.c +++ b/net/core/dev.c @@ -933,20 +933,19 @@ void net_call_rx_atomic(void (*fn)(void)) void (*br_handle_frame_hook)(struct sk_buff *skb) = NULL; #endif -#define HANDLE_BRIDGE(SKB, PT_PREV) \ -do { \ - if ((SKB)->dev->br_port != NULL && \ - br_handle_frame_hook != NULL) { \ - if (PT_PREV) \ - if (!(PT_PREV->data)) \ - deliver_to_old_ones(PT_PREV, SKB, 1); \ - else \ - pt_prev->func(SKB, SKB->dev, PT_PREV); \ - \ - br_handle_frame_hook(SKB); \ - continue; \ - } \ -} while(0) +static void __inline__ handle_bridge(struct sk_buff *skb, + struct packet_type *pt_prev) +{ + if (pt_prev) + deliver_to_old_ones(pt_prev, skb, 0); + else { + atomic_inc(&skb->users); + pt_prev->func(skb, skb->dev, pt_prev); + } + + br_handle_frame_hook(skb); +} + static void net_rx_action(struct softirq_action *h) { @@ -999,7 +998,11 @@ static void net_rx_action(struct softirq_action *h) } #if defined(CONFIG_BRIDGE) || defined(CONFIG_BRIDGE_MODULE) - HANDLE_BRIDGE(skb, pt_prev); + if (skb->dev->br_port != NULL && + br_handle_frame_hook != NULL) { + handle_bridge(skb, pt_prev); + continue; + } #endif for (ptype=ptype_base[ntohs(type)&15];ptype;ptype=ptype->next) { @@ -1856,6 +1859,14 @@ int register_netdevice(struct net_device *dev) *dp = dev; dev_hold(dev); write_unlock_bh(&dev_base_lock); + + /* + * Default initial state at registry is that the + * device is present. + */ + + set_bit(__LINK_STATE_PRESENT, &dev->state); + return 0; } |