rtnetlink.c (e5451c8f8330e03ad3cfa16048b4daf961af434f) rtnetlink.c (472681d57a5dde7c6d16b05469be57f1c4ed9d99)
1/*
2 * INET An implementation of the TCP/IP protocol suite for the LINUX
3 * operating system. INET is implemented using the BSD Socket
4 * interface as the means of communication with the user level.
5 *
6 * Routing netlink socket interface: protocol independent part.
7 *
8 * Authors: Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru>

--- 2897 unchanged lines hidden (view full) ---

2906
2907 netif_addr_lock_bh(dev);
2908 err = nlmsg_populate_fdb(skb, cb, dev, &idx, &dev->uc);
2909 if (err)
2910 goto out;
2911 nlmsg_populate_fdb(skb, cb, dev, &idx, &dev->mc);
2912out:
2913 netif_addr_unlock_bh(dev);
1/*
2 * INET An implementation of the TCP/IP protocol suite for the LINUX
3 * operating system. INET is implemented using the BSD Socket
4 * interface as the means of communication with the user level.
5 *
6 * Routing netlink socket interface: protocol independent part.
7 *
8 * Authors: Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru>

--- 2897 unchanged lines hidden (view full) ---

2906
2907 netif_addr_lock_bh(dev);
2908 err = nlmsg_populate_fdb(skb, cb, dev, &idx, &dev->uc);
2909 if (err)
2910 goto out;
2911 nlmsg_populate_fdb(skb, cb, dev, &idx, &dev->mc);
2912out:
2913 netif_addr_unlock_bh(dev);
2914 cb->args[1] = err;
2914 return idx;
2915}
2916EXPORT_SYMBOL(ndo_dflt_fdb_dump);
2917
2918static int rtnl_fdb_dump(struct sk_buff *skb, struct netlink_callback *cb)
2919{
2920 struct net_device *dev;
2921 struct nlattr *tb[IFLA_MAX+1];

--- 17 unchanged lines hidden (view full) ---

2939 if (br_idx) {
2940 br_dev = __dev_get_by_index(net, br_idx);
2941 if (!br_dev)
2942 return -ENODEV;
2943
2944 ops = br_dev->netdev_ops;
2945 }
2946
2915 return idx;
2916}
2917EXPORT_SYMBOL(ndo_dflt_fdb_dump);
2918
2919static int rtnl_fdb_dump(struct sk_buff *skb, struct netlink_callback *cb)
2920{
2921 struct net_device *dev;
2922 struct nlattr *tb[IFLA_MAX+1];

--- 17 unchanged lines hidden (view full) ---

2940 if (br_idx) {
2941 br_dev = __dev_get_by_index(net, br_idx);
2942 if (!br_dev)
2943 return -ENODEV;
2944
2945 ops = br_dev->netdev_ops;
2946 }
2947
2948 cb->args[1] = 0;
2947 for_each_netdev(net, dev) {
2948 if (brport_idx && (dev->ifindex != brport_idx))
2949 continue;
2950
2951 if (!br_idx) { /* user did not specify a specific bridge */
2952 if (dev->priv_flags & IFF_BRIDGE_PORT) {
2953 br_dev = netdev_master_upper_dev_get(dev);
2954 cops = br_dev->netdev_ops;

--- 11 unchanged lines hidden (view full) ---

2966 cops = ops;
2967 }
2968
2969 if (dev->priv_flags & IFF_BRIDGE_PORT) {
2970 if (cops && cops->ndo_fdb_dump)
2971 idx = cops->ndo_fdb_dump(skb, cb, br_dev, dev,
2972 idx);
2973 }
2949 for_each_netdev(net, dev) {
2950 if (brport_idx && (dev->ifindex != brport_idx))
2951 continue;
2952
2953 if (!br_idx) { /* user did not specify a specific bridge */
2954 if (dev->priv_flags & IFF_BRIDGE_PORT) {
2955 br_dev = netdev_master_upper_dev_get(dev);
2956 cops = br_dev->netdev_ops;

--- 11 unchanged lines hidden (view full) ---

2968 cops = ops;
2969 }
2970
2971 if (dev->priv_flags & IFF_BRIDGE_PORT) {
2972 if (cops && cops->ndo_fdb_dump)
2973 idx = cops->ndo_fdb_dump(skb, cb, br_dev, dev,
2974 idx);
2975 }
2976 if (cb->args[1] == -EMSGSIZE)
2977 break;
2974
2975 if (dev->netdev_ops->ndo_fdb_dump)
2976 idx = dev->netdev_ops->ndo_fdb_dump(skb, cb, dev, NULL,
2977 idx);
2978 else
2979 idx = ndo_dflt_fdb_dump(skb, cb, dev, NULL, idx);
2978
2979 if (dev->netdev_ops->ndo_fdb_dump)
2980 idx = dev->netdev_ops->ndo_fdb_dump(skb, cb, dev, NULL,
2981 idx);
2982 else
2983 idx = ndo_dflt_fdb_dump(skb, cb, dev, NULL, idx);
2984 if (cb->args[1] == -EMSGSIZE)
2985 break;
2980
2981 cops = NULL;
2982 }
2983
2984 cb->args[0] = idx;
2985 return skb->len;
2986}
2987

--- 510 unchanged lines hidden ---
2986
2987 cops = NULL;
2988 }
2989
2990 cb->args[0] = idx;
2991 return skb->len;
2992}
2993

--- 510 unchanged lines hidden ---