#include <linux/netdevice.h>
-/* br_handle_frame_hook() needs the following forward declaration. */
-struct net_bridge_port;
-
extern void brioctl_set(int (*ioctl_hook)(struct net *, unsigned int, void __user *));
extern struct sk_buff *(*br_handle_frame_hook)(struct net_bridge_port *p,
struct sk_buff *skb);
return 0;
rcu_read_lock();
- fdb = __br_fdb_get(br_port(dev)->br, addr);
+ fdb = __br_fdb_get(dev->br_port->br, addr);
ret = fdb && fdb->dst->dev != dev &&
fdb->dst->state == BR_STATE_FORWARDING;
rcu_read_unlock();
return !memcmp(&br->bridge_id, &br->designated_root, 8);
}
-static inline struct net_bridge_port *br_port(const struct net_device *dev)
-{
- return rcu_dereference(dev->br_port);
-}
-
/* br_device.c */
extern void br_dev_setup(struct net_device *dev);
extern netdev_tx_t br_dev_xmit(struct sk_buff *skb,
if (par->hooknum != NF_BR_BROUTING)
memcpy(eth_hdr(skb)->h_dest,
- br_port(par->in)->br->dev->dev_addr, ETH_ALEN);
+ par->in->br_port->br->dev->dev_addr, ETH_ALEN);
else
memcpy(eth_hdr(skb)->h_dest, par->in->dev_addr, ETH_ALEN);
skb->pkt_type = PACKET_HOST;
strcpy(pm->physindev, in->name);
/* If in isn't a bridge, then physindev==indev */
if (in->br_port)
- strcpy(pm->indev, br_port(in)->br->dev->name);
+ strcpy(pm->indev, in->br_port->br->dev->name);
else
strcpy(pm->indev, in->name);
} else
if (out) {
/* If out exists, then out is a bridge port */
strcpy(pm->physoutdev, out->name);
- strcpy(pm->outdev, br_port(out)->br->dev->name);
+ strcpy(pm->outdev, out->br_port->br->dev->name);
} else
pm->outdev[0] = pm->physoutdev[0] = '\0';
if (FWINV2(ebt_dev_check(e->out, out), EBT_IOUT))
return 1;
if ((!in || !in->br_port) ? 0 : FWINV2(ebt_dev_check(
- e->logical_in, br_port(in)->br->dev), EBT_ILOGICALIN))
+ e->logical_in, in->br_port->br->dev), EBT_ILOGICALIN))
return 1;
if ((!out || !out->br_port) ? 0 : FWINV2(ebt_dev_check(
- e->logical_out, br_port(out)->br->dev), EBT_ILOGICALOUT))
+ e->logical_out, out->br_port->br->dev), EBT_ILOGICALOUT))
return 1;
if (e->bitmask & EBT_SOURCEMAC) {
htonl(indev->ifindex));
/* this is the bridge group "brX" */
NLA_PUT_BE32(inst->skb, NFULA_IFINDEX_INDEV,
- htonl(br_port(indev)->br->dev->ifindex));
+ htonl(indev->br_port->br->dev->ifindex));
} else {
/* Case 2: indev is bridge group, we need to look for
* physical device (when called from ipv4) */
htonl(outdev->ifindex));
/* this is the bridge group "brX" */
NLA_PUT_BE32(inst->skb, NFULA_IFINDEX_OUTDEV,
- htonl(br_port(outdev)->br->dev->ifindex));
+ htonl(outdev->br_port->br->dev->ifindex));
} else {
/* Case 2: indev is a bridge group, we need to look
* for physical device (when called from ipv4) */
htonl(indev->ifindex));
/* this is the bridge group "brX" */
NLA_PUT_BE32(skb, NFQA_IFINDEX_INDEV,
- htonl(br_port(indev)->br->dev->ifindex));
+ htonl(indev->br_port->br->dev->ifindex));
} else {
/* Case 2: indev is bridge group, we need to look for
* physical device (when called from ipv4) */
htonl(outdev->ifindex));
/* this is the bridge group "brX" */
NLA_PUT_BE32(skb, NFQA_IFINDEX_OUTDEV,
- htonl(br_port(outdev)->br->dev->ifindex));
+ htonl(outdev->br_port->br->dev->ifindex));
} else {
/* Case 2: outdev is bridge group, we need to look for
* physical output device (when called from ipv4) */