bridge: use rx_handler_data pointer to store net_bridge_port pointer
[deliverable/linux.git] / net / bridge / br_netlink.c
index fe0a79018ab238e0b1adf826b87cf3a97184723b..4a6a378c84e357d06f45ae70fad7cd808c4e8bc8 100644 (file)
@@ -120,10 +120,11 @@ static int br_dump_ifinfo(struct sk_buff *skb, struct netlink_callback *cb)
        idx = 0;
        for_each_netdev(net, dev) {
                /* not a bridge port */
-               if (dev->br_port == NULL || idx < cb->args[0])
+               if (!br_port_exists(dev) || idx < cb->args[0])
                        goto skip;
 
-               if (br_fill_ifinfo(skb, dev->br_port, NETLINK_CB(cb->skb).pid,
+               if (br_fill_ifinfo(skb, br_port_get(dev),
+                                  NETLINK_CB(cb->skb).pid,
                                   cb->nlh->nlmsg_seq, RTM_NEWLINK,
                                   NLM_F_MULTI) < 0)
                        break;
@@ -168,9 +169,9 @@ static int br_rtm_setlink(struct sk_buff *skb,  struct nlmsghdr *nlh, void *arg)
        if (!dev)
                return -ENODEV;
 
-       p = dev->br_port;
-       if (!p)
+       if (!br_port_exists(dev))
                return -EINVAL;
+       p = br_port_get(dev);
 
        /* if kernel STP is running, don't allow changes */
        if (p->br->stp_enabled == BR_KERNEL_STP)
This page took 0.044916 seconds and 5 git commands to generate.