diff options
-rw-r--r-- | drivers/net/ipvlan/ipvlan.h | 9 | ||||
-rw-r--r-- | drivers/net/ipvlan/ipvlan_core.c | 27 | ||||
-rw-r--r-- | drivers/net/ipvlan/ipvlan_main.c | 2 |
3 files changed, 20 insertions, 18 deletions
diff --git a/drivers/net/ipvlan/ipvlan.h b/drivers/net/ipvlan/ipvlan.h index 817cab1a7959..695a5dc9ace3 100644 --- a/drivers/net/ipvlan/ipvlan.h +++ b/drivers/net/ipvlan/ipvlan.h | |||
@@ -84,19 +84,19 @@ struct ipvl_addr { | |||
84 | #define ip4addr ipu.ip4 | 84 | #define ip4addr ipu.ip4 |
85 | struct hlist_node hlnode; /* Hash-table linkage */ | 85 | struct hlist_node hlnode; /* Hash-table linkage */ |
86 | struct list_head anode; /* logical-interface linkage */ | 86 | struct list_head anode; /* logical-interface linkage */ |
87 | struct rcu_head rcu; | ||
88 | ipvl_hdr_type atype; | 87 | ipvl_hdr_type atype; |
88 | struct rcu_head rcu; | ||
89 | }; | 89 | }; |
90 | 90 | ||
91 | struct ipvl_port { | 91 | struct ipvl_port { |
92 | struct net_device *dev; | 92 | struct net_device *dev; |
93 | struct hlist_head hlhead[IPVLAN_HASH_SIZE]; | 93 | struct hlist_head hlhead[IPVLAN_HASH_SIZE]; |
94 | struct list_head ipvlans; | 94 | struct list_head ipvlans; |
95 | struct rcu_head rcu; | 95 | u16 mode; |
96 | struct work_struct wq; | 96 | struct work_struct wq; |
97 | struct sk_buff_head backlog; | 97 | struct sk_buff_head backlog; |
98 | int count; | 98 | int count; |
99 | u16 mode; | 99 | struct rcu_head rcu; |
100 | }; | 100 | }; |
101 | 101 | ||
102 | static inline struct ipvl_port *ipvlan_port_get_rcu(const struct net_device *d) | 102 | static inline struct ipvl_port *ipvlan_port_get_rcu(const struct net_device *d) |
@@ -114,7 +114,6 @@ static inline struct ipvl_port *ipvlan_port_get_rtnl(const struct net_device *d) | |||
114 | return rtnl_dereference(d->rx_handler_data); | 114 | return rtnl_dereference(d->rx_handler_data); |
115 | } | 115 | } |
116 | 116 | ||
117 | void ipvlan_adjust_mtu(struct ipvl_dev *ipvlan, struct net_device *dev); | ||
118 | void ipvlan_init_secret(void); | 117 | void ipvlan_init_secret(void); |
119 | unsigned int ipvlan_mac_hash(const unsigned char *addr); | 118 | unsigned int ipvlan_mac_hash(const unsigned char *addr); |
120 | rx_handler_result_t ipvlan_handle_frame(struct sk_buff **pskb); | 119 | rx_handler_result_t ipvlan_handle_frame(struct sk_buff **pskb); |
@@ -124,7 +123,5 @@ void ipvlan_ht_addr_add(struct ipvl_dev *ipvlan, struct ipvl_addr *addr); | |||
124 | struct ipvl_addr *ipvlan_find_addr(const struct ipvl_dev *ipvlan, | 123 | struct ipvl_addr *ipvlan_find_addr(const struct ipvl_dev *ipvlan, |
125 | const void *iaddr, bool is_v6); | 124 | const void *iaddr, bool is_v6); |
126 | bool ipvlan_addr_busy(struct ipvl_port *port, void *iaddr, bool is_v6); | 125 | bool ipvlan_addr_busy(struct ipvl_port *port, void *iaddr, bool is_v6); |
127 | struct ipvl_addr *ipvlan_ht_addr_lookup(const struct ipvl_port *port, | ||
128 | const void *iaddr, bool is_v6); | ||
129 | void ipvlan_ht_addr_del(struct ipvl_addr *addr); | 126 | void ipvlan_ht_addr_del(struct ipvl_addr *addr); |
130 | #endif /* __IPVLAN_H */ | 127 | #endif /* __IPVLAN_H */ |
diff --git a/drivers/net/ipvlan/ipvlan_core.c b/drivers/net/ipvlan/ipvlan_core.c index 4e60c6bbdb6e..d6d0524ee5fd 100644 --- a/drivers/net/ipvlan/ipvlan_core.c +++ b/drivers/net/ipvlan/ipvlan_core.c | |||
@@ -53,8 +53,8 @@ static u8 ipvlan_get_v4_hash(const void *iaddr) | |||
53 | IPVLAN_HASH_MASK; | 53 | IPVLAN_HASH_MASK; |
54 | } | 54 | } |
55 | 55 | ||
56 | struct ipvl_addr *ipvlan_ht_addr_lookup(const struct ipvl_port *port, | 56 | static struct ipvl_addr *ipvlan_ht_addr_lookup(const struct ipvl_port *port, |
57 | const void *iaddr, bool is_v6) | 57 | const void *iaddr, bool is_v6) |
58 | { | 58 | { |
59 | struct ipvl_addr *addr; | 59 | struct ipvl_addr *addr; |
60 | u8 hash; | 60 | u8 hash; |
@@ -265,20 +265,25 @@ static int ipvlan_rcv_frame(struct ipvl_addr *addr, struct sk_buff **pskb, | |||
265 | struct sk_buff *skb = *pskb; | 265 | struct sk_buff *skb = *pskb; |
266 | 266 | ||
267 | len = skb->len + ETH_HLEN; | 267 | len = skb->len + ETH_HLEN; |
268 | if (unlikely(!(dev->flags & IFF_UP))) { | 268 | /* Only packets exchanged between two local slaves need to have |
269 | kfree_skb(skb); | 269 | * device-up check as well as skb-share check. |
270 | goto out; | 270 | */ |
271 | } | 271 | if (local) { |
272 | if (unlikely(!(dev->flags & IFF_UP))) { | ||
273 | kfree_skb(skb); | ||
274 | goto out; | ||
275 | } | ||
272 | 276 | ||
273 | skb = skb_share_check(skb, GFP_ATOMIC); | 277 | skb = skb_share_check(skb, GFP_ATOMIC); |
274 | if (!skb) | 278 | if (!skb) |
275 | goto out; | 279 | goto out; |
276 | 280 | ||
277 | *pskb = skb; | 281 | *pskb = skb; |
282 | } | ||
278 | skb->dev = dev; | 283 | skb->dev = dev; |
279 | skb->pkt_type = PACKET_HOST; | ||
280 | 284 | ||
281 | if (local) { | 285 | if (local) { |
286 | skb->pkt_type = PACKET_HOST; | ||
282 | if (dev_forward_skb(ipvlan->dev, skb) == NET_RX_SUCCESS) | 287 | if (dev_forward_skb(ipvlan->dev, skb) == NET_RX_SUCCESS) |
283 | success = true; | 288 | success = true; |
284 | } else { | 289 | } else { |
diff --git a/drivers/net/ipvlan/ipvlan_main.c b/drivers/net/ipvlan/ipvlan_main.c index 5bcb852c5500..a7ca1c519a0d 100644 --- a/drivers/net/ipvlan/ipvlan_main.c +++ b/drivers/net/ipvlan/ipvlan_main.c | |||
@@ -9,7 +9,7 @@ | |||
9 | 9 | ||
10 | #include "ipvlan.h" | 10 | #include "ipvlan.h" |
11 | 11 | ||
12 | void ipvlan_adjust_mtu(struct ipvl_dev *ipvlan, struct net_device *dev) | 12 | static void ipvlan_adjust_mtu(struct ipvl_dev *ipvlan, struct net_device *dev) |
13 | { | 13 | { |
14 | ipvlan->dev->mtu = dev->mtu - ipvlan->mtu_adj; | 14 | ipvlan->dev->mtu = dev->mtu - ipvlan->mtu_adj; |
15 | } | 15 | } |