diff options
Diffstat (limited to 'include/linux/if_vlan.h')
-rw-r--r-- | include/linux/if_vlan.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/include/linux/if_vlan.h b/include/linux/if_vlan.h index 79504b22a932..15ace02b7b24 100644 --- a/include/linux/if_vlan.h +++ b/include/linux/if_vlan.h | |||
@@ -81,7 +81,9 @@ extern void vlan_ioctl_set(int (*hook)(struct net *, void __user *)); | |||
81 | #define VLAN_GROUP_ARRAY_PART_LEN (VLAN_GROUP_ARRAY_LEN/VLAN_GROUP_ARRAY_SPLIT_PARTS) | 81 | #define VLAN_GROUP_ARRAY_PART_LEN (VLAN_GROUP_ARRAY_LEN/VLAN_GROUP_ARRAY_SPLIT_PARTS) |
82 | 82 | ||
83 | struct vlan_group { | 83 | struct vlan_group { |
84 | int real_dev_ifindex; /* The ifindex of the ethernet(like) device the vlan is attached to. */ | 84 | struct net_device *real_dev; /* The ethernet(like) device |
85 | * the vlan is attached to. | ||
86 | */ | ||
85 | unsigned int nr_vlans; | 87 | unsigned int nr_vlans; |
86 | struct hlist_node hlist; /* linked list */ | 88 | struct hlist_node hlist; /* linked list */ |
87 | struct net_device **vlan_devices_arrays[VLAN_GROUP_ARRAY_SPLIT_PARTS]; | 89 | struct net_device **vlan_devices_arrays[VLAN_GROUP_ARRAY_SPLIT_PARTS]; |
@@ -93,7 +95,7 @@ static inline struct net_device *vlan_group_get_device(struct vlan_group *vg, | |||
93 | { | 95 | { |
94 | struct net_device **array; | 96 | struct net_device **array; |
95 | array = vg->vlan_devices_arrays[vlan_id / VLAN_GROUP_ARRAY_PART_LEN]; | 97 | array = vg->vlan_devices_arrays[vlan_id / VLAN_GROUP_ARRAY_PART_LEN]; |
96 | return array[vlan_id % VLAN_GROUP_ARRAY_PART_LEN]; | 98 | return array ? array[vlan_id % VLAN_GROUP_ARRAY_PART_LEN] : NULL; |
97 | } | 99 | } |
98 | 100 | ||
99 | static inline void vlan_group_set_device(struct vlan_group *vg, | 101 | static inline void vlan_group_set_device(struct vlan_group *vg, |