All of lore.kernel.org
 help / color / mirror / Atom feed
* [batman:batadv/net 6/9] net/batman-adv/soft-interface.c:367:10: error: implicit declaration of function 'batadv_mcast_forw_send_orig'
@ 2020-09-14 18:36 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2020-09-14 18:36 UTC (permalink / raw)
  To: kbuild-all

[-- Attachment #1: Type: text/plain, Size: 10002 bytes --]

tree:   https://git.open-mesh.org/linux-merge.git batadv/net
head:   11dcc3a7f22d3ee9535bb6c78b493ee002247dd7
commit: 8a75962cf0639f0bd908d46923dbfb2e7fddedf7 [6/9] batman-adv: mcast: fix duplicate mcast packets in BLA backbone from LAN
config: x86_64-randconfig-r021-20200914 (attached as .config)
compiler: clang version 12.0.0 (https://github.com/llvm/llvm-project b2c32c90bab09a6e2c1f370429db26017a182143)
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # install x86_64 cross compiling tool for clang build
        # apt-get install binutils-x86-64-linux-gnu
        git checkout 8a75962cf0639f0bd908d46923dbfb2e7fddedf7
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All errors (new ones prefixed by >>):

>> net/batman-adv/soft-interface.c:367:10: error: implicit declaration of function 'batadv_mcast_forw_send_orig' [-Werror,-Wimplicit-function-declaration]
                           ret = batadv_mcast_forw_send_orig(bat_priv, skb, vid,
                                 ^
   net/batman-adv/soft-interface.c:367:10: note: did you mean 'batadv_mcast_forw_send'?
   net/batman-adv/multicast.h:80:1: note: 'batadv_mcast_forw_send' declared here
   batadv_mcast_forw_send(struct batadv_priv *bat_priv, struct sk_buff *skb,
   ^
   1 error generated.

git remote add batman https://git.open-mesh.org/linux-merge.git
git fetch --no-tags batman batadv/net
git checkout 8a75962cf0639f0bd908d46923dbfb2e7fddedf7
vim +/batadv_mcast_forw_send_orig +367 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_mcast_forw_send_orig(bat_priv, skb, vid,
   368								  mcast_single_orig);
   369			} else if (forw_mode == BATADV_FORW_SOME) {
   370				ret = batadv_mcast_forw_send(bat_priv, skb, vid);
   371			} else {
   372				if (batadv_dat_snoop_outgoing_arp_request(bat_priv,
   373									  skb))
   374					goto dropped;
   375	
   376				batadv_dat_snoop_outgoing_arp_reply(bat_priv, skb);
   377	
   378				ret = batadv_send_skb_via_tt(bat_priv, skb, dst_hint,
   379							     vid);
   380			}
   381			if (ret != NET_XMIT_SUCCESS)
   382				goto dropped_freed;
   383		}
   384	
   385		batadv_inc_counter(bat_priv, BATADV_CNT_TX);
   386		batadv_add_counter(bat_priv, BATADV_CNT_TX_BYTES, data_len);
   387		goto end;
   388	
   389	dropped:
   390		kfree_skb(skb);
   391	dropped_freed:
   392		batadv_inc_counter(bat_priv, BATADV_CNT_TX_DROPPED);
   393	end:
   394		if (mcast_single_orig)
   395			batadv_orig_node_put(mcast_single_orig);
   396		if (primary_if)
   397			batadv_hardif_put(primary_if);
   398		return NETDEV_TX_OK;
   399	}
   400	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 35171 bytes --]

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-09-14 18:36 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-14 18:36 [batman:batadv/net 6/9] net/batman-adv/soft-interface.c:367:10: error: implicit declaration of function 'batadv_mcast_forw_send_orig' kernel test robot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.