rtnetlink.c (7b46a644a407f9f2f1c8f7b2af157c79af55b49e) | rtnetlink.c (4de8b413700e78560388eb14c4bbc67aff62da6d) |
---|---|
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> --- 2904 unchanged lines hidden (view full) --- 2913 2914static int rtnl_bridge_setlink(struct sk_buff *skb, struct nlmsghdr *nlh) 2915{ 2916 struct net *net = sock_net(skb->sk); 2917 struct ifinfomsg *ifm; 2918 struct net_device *dev; 2919 struct nlattr *br_spec, *attr = NULL; 2920 int rem, err = -EOPNOTSUPP; | 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> --- 2904 unchanged lines hidden (view full) --- 2913 2914static int rtnl_bridge_setlink(struct sk_buff *skb, struct nlmsghdr *nlh) 2915{ 2916 struct net *net = sock_net(skb->sk); 2917 struct ifinfomsg *ifm; 2918 struct net_device *dev; 2919 struct nlattr *br_spec, *attr = NULL; 2920 int rem, err = -EOPNOTSUPP; |
2921 u16 oflags, flags = 0; | 2921 u16 flags = 0; |
2922 bool have_flags = false; 2923 2924 if (nlmsg_len(nlh) < sizeof(*ifm)) 2925 return -EINVAL; 2926 2927 ifm = nlmsg_data(nlh); 2928 if (ifm->ifi_family != AF_BRIDGE) 2929 return -EPFNOSUPPORT; --- 13 unchanged lines hidden (view full) --- 2943 2944 have_flags = true; 2945 flags = nla_get_u16(attr); 2946 break; 2947 } 2948 } 2949 } 2950 | 2922 bool have_flags = false; 2923 2924 if (nlmsg_len(nlh) < sizeof(*ifm)) 2925 return -EINVAL; 2926 2927 ifm = nlmsg_data(nlh); 2928 if (ifm->ifi_family != AF_BRIDGE) 2929 return -EPFNOSUPPORT; --- 13 unchanged lines hidden (view full) --- 2943 2944 have_flags = true; 2945 flags = nla_get_u16(attr); 2946 break; 2947 } 2948 } 2949 } 2950 |
2951 oflags = flags; 2952 | |
2953 if (!flags || (flags & BRIDGE_FLAGS_MASTER)) { 2954 struct net_device *br_dev = netdev_master_upper_dev_get(dev); 2955 2956 if (!br_dev || !br_dev->netdev_ops->ndo_bridge_setlink) { 2957 err = -EOPNOTSUPP; 2958 goto out; 2959 } 2960 --- 27 unchanged lines hidden (view full) --- 2988 2989static int rtnl_bridge_dellink(struct sk_buff *skb, struct nlmsghdr *nlh) 2990{ 2991 struct net *net = sock_net(skb->sk); 2992 struct ifinfomsg *ifm; 2993 struct net_device *dev; 2994 struct nlattr *br_spec, *attr = NULL; 2995 int rem, err = -EOPNOTSUPP; | 2951 if (!flags || (flags & BRIDGE_FLAGS_MASTER)) { 2952 struct net_device *br_dev = netdev_master_upper_dev_get(dev); 2953 2954 if (!br_dev || !br_dev->netdev_ops->ndo_bridge_setlink) { 2955 err = -EOPNOTSUPP; 2956 goto out; 2957 } 2958 --- 27 unchanged lines hidden (view full) --- 2986 2987static int rtnl_bridge_dellink(struct sk_buff *skb, struct nlmsghdr *nlh) 2988{ 2989 struct net *net = sock_net(skb->sk); 2990 struct ifinfomsg *ifm; 2991 struct net_device *dev; 2992 struct nlattr *br_spec, *attr = NULL; 2993 int rem, err = -EOPNOTSUPP; |
2996 u16 oflags, flags = 0; | 2994 u16 flags = 0; |
2997 bool have_flags = false; 2998 2999 if (nlmsg_len(nlh) < sizeof(*ifm)) 3000 return -EINVAL; 3001 3002 ifm = nlmsg_data(nlh); 3003 if (ifm->ifi_family != AF_BRIDGE) 3004 return -EPFNOSUPPORT; --- 13 unchanged lines hidden (view full) --- 3018 3019 have_flags = true; 3020 flags = nla_get_u16(attr); 3021 break; 3022 } 3023 } 3024 } 3025 | 2995 bool have_flags = false; 2996 2997 if (nlmsg_len(nlh) < sizeof(*ifm)) 2998 return -EINVAL; 2999 3000 ifm = nlmsg_data(nlh); 3001 if (ifm->ifi_family != AF_BRIDGE) 3002 return -EPFNOSUPPORT; --- 13 unchanged lines hidden (view full) --- 3016 3017 have_flags = true; 3018 flags = nla_get_u16(attr); 3019 break; 3020 } 3021 } 3022 } 3023 |
3026 oflags = flags; 3027 | |
3028 if (!flags || (flags & BRIDGE_FLAGS_MASTER)) { 3029 struct net_device *br_dev = netdev_master_upper_dev_get(dev); 3030 3031 if (!br_dev || !br_dev->netdev_ops->ndo_bridge_dellink) { 3032 err = -EOPNOTSUPP; 3033 goto out; 3034 } 3035 --- 180 unchanged lines hidden --- | 3024 if (!flags || (flags & BRIDGE_FLAGS_MASTER)) { 3025 struct net_device *br_dev = netdev_master_upper_dev_get(dev); 3026 3027 if (!br_dev || !br_dev->netdev_ops->ndo_bridge_dellink) { 3028 err = -EOPNOTSUPP; 3029 goto out; 3030 } 3031 --- 180 unchanged lines hidden --- |