tree:
https://git.open-mesh.org/linux-merge.git batadv/net-next
head: 8a2a8331b462cc285c700c89ae8f61a434099919
commit: 4de3cfb7107d8dc89178465dc50b1259013a3dbc [4/5] batman-adv: Use
'fallthrough' pseudo keyword
config: i386-randconfig-b003-201943 (attached as .config)
compiler: gcc-7 (Debian 7.4.0-14) 7.4.0
reproduce:
git checkout 4de3cfb7107d8dc89178465dc50b1259013a3dbc
# save the attached .config to linux build tree
make ARCH=i386
If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
net//batman-adv/soft-interface.c: In function 'batadv_interface_tx':
> net//batman-adv/soft-interface.c:233:3: error:
'fallthrough' undeclared (first use in this function)
fallthrough;
^~~~~~~~~~~
net//batman-adv/soft-interface.c:233:3: note: each undeclared identifier is reported
only once for each function it appears in
net//batman-adv/soft-interface.c: In function 'batadv_interface_rx':
net//batman-adv/soft-interface.c:458:3: error: 'fallthrough' undeclared (first
use in this function)
fallthrough;
^~~~~~~~~~~
vim +/fallthrough +233 net//batman-adv/soft-interface.c
179
180 static netdev_tx_t batadv_interface_tx(struct sk_buff *skb,
181 struct net_device *soft_iface)
182 {
183 struct ethhdr *ethhdr;
184 struct batadv_priv *bat_priv = netdev_priv(soft_iface);
185 struct batadv_hard_iface *primary_if = NULL;
186 struct batadv_bcast_packet *bcast_packet;
187 static const u8 stp_addr[ETH_ALEN] = {0x01, 0x80, 0xC2, 0x00,
188 0x00, 0x00};
189 static const u8 ectp_addr[ETH_ALEN] = {0xCF, 0x00, 0x00, 0x00,
190 0x00, 0x00};
191 enum batadv_dhcp_recipient dhcp_rcp = BATADV_DHCP_NO;
192 u8 *dst_hint = NULL, chaddr[ETH_ALEN];
193 struct vlan_ethhdr *vhdr;
194 unsigned int header_len = 0;
195 int data_len = skb->len, ret;
196 unsigned long brd_delay = 1;
197 bool do_bcast = false, client_added;
198 unsigned short vid;
199 u32 seqno;
200 int gw_mode;
201 enum batadv_forw_mode forw_mode = BATADV_FORW_SINGLE;
202 struct batadv_orig_node *mcast_single_orig = NULL;
203 int network_offset = ETH_HLEN;
204 __be16 proto;
205
206 if (atomic_read(&bat_priv->mesh_state) != BATADV_MESH_ACTIVE)
207 goto dropped;
208
209 /* reset control block to avoid left overs from previous users */
210 memset(skb->cb, 0, sizeof(struct batadv_skb_cb));
211
212 netif_trans_update(soft_iface);
213 vid = batadv_get_vid(skb, 0);
214
215 skb_reset_mac_header(skb);
216 ethhdr = eth_hdr(skb);
217
218 proto = ethhdr->h_proto;
219
220 switch (ntohs(proto)) {
221 case ETH_P_8021Q:
222 if (!pskb_may_pull(skb, sizeof(*vhdr)))
223 goto dropped;
224 vhdr = vlan_eth_hdr(skb);
225 proto = vhdr->h_vlan_encapsulated_proto;
226
227 /* drop batman-in-batman packets to prevent loops */
228 if (proto != htons(ETH_P_BATMAN)) {
229 network_offset += VLAN_HLEN;
230 break;
231 }
232
233 fallthrough;
234 case ETH_P_BATMAN:
235 goto dropped;
236 }
237
238 skb_set_network_header(skb, network_offset);
239
240 if (batadv_bla_tx(bat_priv, skb, vid))
241 goto dropped;
242
243 /* skb->data might have been reallocated by batadv_bla_tx() */
244 ethhdr = eth_hdr(skb);
245
246 /* Register the client MAC in the transtable */
247 if (!is_multicast_ether_addr(ethhdr->h_source) &&
248 !batadv_bla_is_loopdetect_mac(ethhdr->h_source)) {
249 client_added = batadv_tt_local_add(soft_iface, ethhdr->h_source,
250 vid, skb->skb_iif,
251 skb->mark);
252 if (!client_added)
253 goto dropped;
254 }
255
256 /* Snoop address candidates from DHCPACKs for early DAT filling */
257 batadv_dat_snoop_outgoing_dhcp_ack(bat_priv, skb, proto, vid);
258
259 /* don't accept stp packets. STP does not help in meshes.
260 * better use the bridge loop avoidance ...
261 *
262 * The same goes for ECTP sent at least by some Cisco Switches,
263 * it might confuse the mesh when used with bridge loop avoidance.
264 */
265 if (batadv_compare_eth(ethhdr->h_dest, stp_addr))
266 goto dropped;
267
268 if (batadv_compare_eth(ethhdr->h_dest, ectp_addr))
269 goto dropped;
270
271 gw_mode = atomic_read(&bat_priv->gw.mode);
272 if (is_multicast_ether_addr(ethhdr->h_dest)) {
273 /* if gw mode is off, broadcast every packet */
274 if (gw_mode == BATADV_GW_MODE_OFF) {
275 do_bcast = true;
276 goto send;
277 }
278
279 dhcp_rcp = batadv_gw_dhcp_recipient_get(skb, &header_len,
280 chaddr);
281 /* skb->data may have been modified by
282 * batadv_gw_dhcp_recipient_get()
283 */
284 ethhdr = eth_hdr(skb);
285 /* if gw_mode is on, broadcast any non-DHCP message.
286 * All the DHCP packets are going to be sent as unicast
287 */
288 if (dhcp_rcp == BATADV_DHCP_NO) {
289 do_bcast = true;
290 goto send;
291 }
292
293 if (dhcp_rcp == BATADV_DHCP_TO_CLIENT)
294 dst_hint = chaddr;
295 else if ((gw_mode == BATADV_GW_MODE_SERVER) &&
296 (dhcp_rcp == BATADV_DHCP_TO_SERVER))
297 /* gateways should not forward any DHCP message if
298 * directed to a DHCP server
299 */
300 goto dropped;
301
302 send:
303 if (do_bcast && !is_broadcast_ether_addr(ethhdr->h_dest)) {
304 forw_mode = batadv_mcast_forw_mode(bat_priv, skb,
305 &mcast_single_orig);
306 if (forw_mode == BATADV_FORW_NONE)
307 goto dropped;
308
309 if (forw_mode == BATADV_FORW_SINGLE ||
310 forw_mode == BATADV_FORW_SOME)
311 do_bcast = false;
312 }
313 }
314
315 batadv_skb_set_priority(skb, 0);
316
317 /* ethernet packet should be broadcasted */
318 if (do_bcast) {
319 primary_if = batadv_primary_if_get_selected(bat_priv);
320 if (!primary_if)
321 goto dropped;
322
323 /* in case of ARP request, we do not immediately broadcasti the
324 * packet, instead we first wait for DAT to try to retrieve the
325 * correct ARP entry
326 */
327 if (batadv_dat_snoop_outgoing_arp_request(bat_priv, skb))
328 brd_delay = msecs_to_jiffies(ARP_REQ_DELAY);
329
330 if (batadv_skb_head_push(skb, sizeof(*bcast_packet)) < 0)
331 goto dropped;
332
333 bcast_packet = (struct batadv_bcast_packet *)skb->data;
334 bcast_packet->version = BATADV_COMPAT_VERSION;
335 bcast_packet->ttl = BATADV_TTL;
336
337 /* batman packet type: broadcast */
338 bcast_packet->packet_type = BATADV_BCAST;
339 bcast_packet->reserved = 0;
340
341 /* hw address of first interface is the orig mac because only
342 * this mac is known throughout the mesh
343 */
344 ether_addr_copy(bcast_packet->orig,
345 primary_if->net_dev->dev_addr);
346
347 /* set broadcast sequence number */
348 seqno = atomic_inc_return(&bat_priv->bcast_seqno);
349 bcast_packet->seqno = htonl(seqno);
350
351 batadv_add_bcast_packet_to_list(bat_priv, skb, brd_delay, true);
352
353 /* a copy is stored in the bcast list, therefore removing
354 * the original skb.
355 */
356 consume_skb(skb);
357
358 /* unicast packet */
359 } else {
360 /* DHCP packets going to a server will use the GW feature */
361 if (dhcp_rcp == BATADV_DHCP_TO_SERVER) {
362 ret = batadv_gw_out_of_range(bat_priv, skb);
363 if (ret)
364 goto dropped;
365 ret = batadv_send_skb_via_gw(bat_priv, skb, vid);
366 } else if (mcast_single_orig) {
367 ret = batadv_send_skb_unicast(bat_priv, skb,
368 BATADV_UNICAST, 0,
369 mcast_single_orig, vid);
370 } else if (forw_mode == BATADV_FORW_SOME) {
371 ret = batadv_mcast_forw_send(bat_priv, skb, vid);
372 } else {
373 if (batadv_dat_snoop_outgoing_arp_request(bat_priv,
374 skb))
375 goto dropped;
376
377 batadv_dat_snoop_outgoing_arp_reply(bat_priv, skb);
378
379 ret = batadv_send_skb_via_tt(bat_priv, skb, dst_hint,
380 vid);
381 }
382 if (ret != NET_XMIT_SUCCESS)
383 goto dropped_freed;
384 }
385
386 batadv_inc_counter(bat_priv, BATADV_CNT_TX);
387 batadv_add_counter(bat_priv, BATADV_CNT_TX_BYTES, data_len);
388 goto end;
389
390 dropped:
391 kfree_skb(skb);
392 dropped_freed:
393 batadv_inc_counter(bat_priv, BATADV_CNT_TX_DROPPED);
394 end:
395 if (mcast_single_orig)
396 batadv_orig_node_put(mcast_single_orig);
397 if (primary_if)
398 batadv_hardif_put(primary_if);
399 return NETDEV_TX_OK;
400 }
401
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation