diff options
Diffstat (limited to 'include/net/vxlan.h')
-rw-r--r-- | include/net/vxlan.h | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/include/net/vxlan.h b/include/net/vxlan.h index 480a319b4c92..c1c899c3a51b 100644 --- a/include/net/vxlan.h +++ b/include/net/vxlan.h | |||
@@ -152,7 +152,10 @@ struct vxlan_config { | |||
152 | struct vxlan_dev { | 152 | struct vxlan_dev { |
153 | struct hlist_node hlist; /* vni hash table */ | 153 | struct hlist_node hlist; /* vni hash table */ |
154 | struct list_head next; /* vxlan's per namespace list */ | 154 | struct list_head next; /* vxlan's per namespace list */ |
155 | struct vxlan_sock *vn_sock; /* listening socket */ | 155 | struct vxlan_sock *vn4_sock; /* listening socket for IPv4 */ |
156 | #if IS_ENABLED(CONFIG_IPV6) | ||
157 | struct vxlan_sock *vn6_sock; /* listening socket for IPv6 */ | ||
158 | #endif | ||
156 | struct net_device *dev; | 159 | struct net_device *dev; |
157 | struct net *net; /* netns for packet i/o */ | 160 | struct net *net; /* netns for packet i/o */ |
158 | struct vxlan_rdst default_dst; /* default destination */ | 161 | struct vxlan_rdst default_dst; /* default destination */ |
@@ -195,9 +198,14 @@ struct vxlan_dev { | |||
195 | struct net_device *vxlan_dev_create(struct net *net, const char *name, | 198 | struct net_device *vxlan_dev_create(struct net *net, const char *name, |
196 | u8 name_assign_type, struct vxlan_config *conf); | 199 | u8 name_assign_type, struct vxlan_config *conf); |
197 | 200 | ||
198 | static inline __be16 vxlan_dev_dst_port(struct vxlan_dev *vxlan) | 201 | static inline __be16 vxlan_dev_dst_port(struct vxlan_dev *vxlan, |
202 | unsigned short family) | ||
199 | { | 203 | { |
200 | return inet_sk(vxlan->vn_sock->sock->sk)->inet_sport; | 204 | #if IS_ENABLED(CONFIG_IPV6) |
205 | if (family == AF_INET6) | ||
206 | return inet_sk(vxlan->vn6_sock->sock->sk)->inet_sport; | ||
207 | #endif | ||
208 | return inet_sk(vxlan->vn4_sock->sock->sk)->inet_sport; | ||
201 | } | 209 | } |
202 | 210 | ||
203 | static inline netdev_features_t vxlan_features_check(struct sk_buff *skb, | 211 | static inline netdev_features_t vxlan_features_check(struct sk_buff *skb, |