Re: net/tipc/udp_media.c:743: undefined reference to `ipv6_dev_find'

2020-08-16 Thread Xin Long
On Sun, Aug 16, 2020 at 4:32 PM kernel test robot  wrote:
>
> Hi Xin,
>
> FYI, the error/warning still remains.
>
> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 
> master
> head:   4b6c093e21d36bede0fd88fd0aeb3b03647260e4
> commit: 5a6f6f579178dbeb33002d93b4f646c31348fac9 tipc: set ub->ifindex for 
> local ipv6 address
> date:   11 days ago
> config: parisc-randconfig-r032-20200816 (attached as .config)
> compiler: hppa-linux-gcc (GCC) 9.3.0
> 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
> git checkout 5a6f6f579178dbeb33002d93b4f646c31348fac9
> # save the attached .config to linux build tree
> COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross 
> ARCH=parisc
>
> If you fix the issue, kindly add following tag as appropriate
> Reported-by: kernel test robot 
>
> All errors (new ones prefixed by >>):
>
>    hppa-linux-ld: net/tipc/udp_media.o: in function `tipc_udp_enable':
> >> net/tipc/udp_media.c:743: undefined reference to `ipv6_dev_find'
>
> vim +743 net/tipc/udp_media.c
>
>642
>643  /**
>644   * tipc_udp_enable - callback to create a new udp bearer instance
>645   * @net:network namespace
>646   * @b:  pointer to generic tipc_bearer
>647   * @attrs:  netlink bearer configuration
>648   *
>649   * validate the bearer parameters and initialize the udp bearer
>650   * rtnl_lock should be held
>651   */
>652  static int tipc_udp_enable(struct net *net, struct tipc_bearer *b,
>653 struct nlattr *attrs[])
>654  {
>655  int err = -EINVAL;
>656  struct udp_bearer *ub;
>657  struct udp_media_addr remote = {0};
>658  struct udp_media_addr local = {0};
>659  struct udp_port_cfg udp_conf = {0};
>660  struct udp_tunnel_sock_cfg tuncfg = {NULL};
>661  struct nlattr *opts[TIPC_NLA_UDP_MAX + 1];
>662  u8 node_id[NODE_ID_LEN] = {0,};
>663  int rmcast = 0;
>664
>665  ub = kzalloc(sizeof(*ub), GFP_ATOMIC);
>666  if (!ub)
>667  return -ENOMEM;
>668
>669  INIT_LIST_HEAD(>rcast.list);
>670
>671  if (!attrs[TIPC_NLA_BEARER_UDP_OPTS])
>672  goto err;
>673
>674  if (nla_parse_nested_deprecated(opts, TIPC_NLA_UDP_MAX, 
> attrs[TIPC_NLA_BEARER_UDP_OPTS], tipc_nl_udp_policy, NULL))
>675  goto err;
>676
>677  if (!opts[TIPC_NLA_UDP_LOCAL] || !opts[TIPC_NLA_UDP_REMOTE]) {
>678  pr_err("Invalid UDP bearer configuration");
>679  err = -EINVAL;
>680  goto err;
>681  }
>682
>683  err = tipc_parse_udp_addr(opts[TIPC_NLA_UDP_LOCAL], ,
>684>ifindex);
>685  if (err)
>686  goto err;
>687
>688  err = tipc_parse_udp_addr(opts[TIPC_NLA_UDP_REMOTE], , 
> NULL);
>689  if (err)
>690  goto err;
>691
>692  if (remote.proto != local.proto) {
>693  err = -EINVAL;
>694  goto err;
>695  }
>696
>697  /* Checking remote ip address */
>698  rmcast = tipc_udp_is_mcast_addr();
>699
>700  /* Autoconfigure own node identity if needed */
>701  if (!tipc_own_id(net)) {
>702  memcpy(node_id, local.ipv6.in6_u.u6_addr8, 16);
>703  tipc_net_init(net, node_id, 0);
>704  }
>705  if (!tipc_own_id(net)) {
>706  pr_warn("Failed to set node id, please configure 
> manually\n");
>707  err = -EINVAL;
>708  goto err;
>709  }
>710
>711  b->bcast_addr.media_id = TIPC_MEDIA_TYPE_UDP;
>712  b->bcast_addr.broadcast = TIPC_BROADCAST_SUPPORT;
>713  rcu_assign_pointer(b->media_ptr, ub);
>714  rcu_assign_pointer(ub->bearer, b);
>715  tipc_udp_media_addr_set(>addr, );
>716  if (local.proto == htons(ETH_P_IP)) {
>717  struct net_device *dev;
>718
>719  dev = __ip_dev_find(net, local.ipv4.s_addr, false);
>720  if (!dev) {
>721

net/tipc/udp_media.c:743: undefined reference to `ipv6_dev_find'

2020-08-16 Thread kernel test robot
Hi Xin,

FYI, the error/warning still remains.

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 
master
head:   4b6c093e21d36bede0fd88fd0aeb3b03647260e4
commit: 5a6f6f579178dbeb33002d93b4f646c31348fac9 tipc: set ub->ifindex for 
local ipv6 address
date:   11 days ago
config: parisc-randconfig-r032-20200816 (attached as .config)
compiler: hppa-linux-gcc (GCC) 9.3.0
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
git checkout 5a6f6f579178dbeb33002d93b4f646c31348fac9
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross 
ARCH=parisc 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot 

All errors (new ones prefixed by >>):

   hppa-linux-ld: net/tipc/udp_media.o: in function `tipc_udp_enable':
>> net/tipc/udp_media.c:743: undefined reference to `ipv6_dev_find'

vim +743 net/tipc/udp_media.c

   642  
   643  /**
   644   * tipc_udp_enable - callback to create a new udp bearer instance
   645   * @net:network namespace
   646   * @b:  pointer to generic tipc_bearer
   647   * @attrs:  netlink bearer configuration
   648   *
   649   * validate the bearer parameters and initialize the udp bearer
   650   * rtnl_lock should be held
   651   */
   652  static int tipc_udp_enable(struct net *net, struct tipc_bearer *b,
   653 struct nlattr *attrs[])
   654  {
   655  int err = -EINVAL;
   656  struct udp_bearer *ub;
   657  struct udp_media_addr remote = {0};
   658  struct udp_media_addr local = {0};
   659  struct udp_port_cfg udp_conf = {0};
   660  struct udp_tunnel_sock_cfg tuncfg = {NULL};
   661  struct nlattr *opts[TIPC_NLA_UDP_MAX + 1];
   662  u8 node_id[NODE_ID_LEN] = {0,};
   663  int rmcast = 0;
   664  
   665  ub = kzalloc(sizeof(*ub), GFP_ATOMIC);
   666  if (!ub)
   667  return -ENOMEM;
   668  
   669  INIT_LIST_HEAD(>rcast.list);
   670  
   671  if (!attrs[TIPC_NLA_BEARER_UDP_OPTS])
   672  goto err;
   673  
   674  if (nla_parse_nested_deprecated(opts, TIPC_NLA_UDP_MAX, 
attrs[TIPC_NLA_BEARER_UDP_OPTS], tipc_nl_udp_policy, NULL))
   675  goto err;
   676  
   677  if (!opts[TIPC_NLA_UDP_LOCAL] || !opts[TIPC_NLA_UDP_REMOTE]) {
   678  pr_err("Invalid UDP bearer configuration");
   679  err = -EINVAL;
   680  goto err;
   681  }
   682  
   683  err = tipc_parse_udp_addr(opts[TIPC_NLA_UDP_LOCAL], ,
   684>ifindex);
   685  if (err)
   686  goto err;
   687  
   688  err = tipc_parse_udp_addr(opts[TIPC_NLA_UDP_REMOTE], , 
NULL);
   689  if (err)
   690  goto err;
   691  
   692  if (remote.proto != local.proto) {
   693  err = -EINVAL;
   694  goto err;
   695  }
   696  
   697  /* Checking remote ip address */
   698  rmcast = tipc_udp_is_mcast_addr();
   699  
   700  /* Autoconfigure own node identity if needed */
   701  if (!tipc_own_id(net)) {
   702  memcpy(node_id, local.ipv6.in6_u.u6_addr8, 16);
   703  tipc_net_init(net, node_id, 0);
   704  }
   705  if (!tipc_own_id(net)) {
   706  pr_warn("Failed to set node id, please configure 
manually\n");
   707  err = -EINVAL;
   708  goto err;
   709  }
   710  
   711  b->bcast_addr.media_id = TIPC_MEDIA_TYPE_UDP;
   712  b->bcast_addr.broadcast = TIPC_BROADCAST_SUPPORT;
   713  rcu_assign_pointer(b->media_ptr, ub);
   714  rcu_assign_pointer(ub->bearer, b);
   715  tipc_udp_media_addr_set(>addr, );
   716  if (local.proto == htons(ETH_P_IP)) {
   717  struct net_device *dev;
   718  
   719  dev = __ip_dev_find(net, local.ipv4.s_addr, false);
   720  if (!dev) {
   721  err = -ENODEV;
   722  goto err;
   723  }
   724  udp_conf.family = AF_INET;
   725  
   726  /* Switch to use ANY to receive packets from group */
   727  if (rmcast)
   728  udp_conf.local_ip.s_addr = htonl(INADDR_ANY);
   729  else
   730  udp_conf.local_ip.s_addr = local.ipv4.s_addr;
   731  udp_conf.use_udp_checksums = false;
   732  ub->ifindex = dev->ifindex;
   733   

Re: net/tipc/udp_media.c:743: undefined reference to `ipv6_dev_find'

2020-08-13 Thread Randy Dunlap
On 8/13/20 2:35 AM, Xin Long wrote:
> On Wed, Aug 12, 2020 at 7:21 AM kernel test robot  wrote:
>>
>> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 
>> master
>> head:   c636eef2ee3696f261a35f34989842701a107895
>> commit: 5a6f6f579178dbeb33002d93b4f646c31348fac9 tipc: set ub->ifindex for 
>> local ipv6 address
>> date:   6 days ago
>> config: ia64-randconfig-r005-20200811 (attached as .config)
>> compiler: ia64-linux-gcc (GCC) 9.3.0
>> 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
>> git checkout 5a6f6f579178dbeb33002d93b4f646c31348fac9
>> # save the attached .config to linux build tree
>> COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross 
>> ARCH=ia64
>>
>> If you fix the issue, kindly add following tag as appropriate
>> Reported-by: kernel test robot 
>>
>> All errors (new ones prefixed by >>):
>>
>>ia64-linux-ld: net/tipc/udp_media.o: in function `tipc_udp_enable':
>>>> net/tipc/udp_media.c:743: undefined reference to `ipv6_dev_find'
> To use some APIs exported from ipv6 code.
> We need add this:
> 
> --- a/net/tipc/Kconfig
> +++ b/net/tipc/Kconfig
> @@ -6,6 +6,7 @@
>  menuconfig TIPC
> tristate "The TIPC Protocol"
> depends on INET
> +   depends on IPV6 || IPV6=n
> 

Thanks. Works for me.

Acked-by: Randy Dunlap  # build-tested

Please make a proper patch and send it to the maintainers.
-- 
~Randy


Re: net/tipc/udp_media.c:743: undefined reference to `ipv6_dev_find'

2020-08-13 Thread Xin Long
On Wed, Aug 12, 2020 at 7:21 AM kernel test robot  wrote:
>
> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 
> master
> head:   c636eef2ee3696f261a35f34989842701a107895
> commit: 5a6f6f579178dbeb33002d93b4f646c31348fac9 tipc: set ub->ifindex for 
> local ipv6 address
> date:   6 days ago
> config: ia64-randconfig-r005-20200811 (attached as .config)
> compiler: ia64-linux-gcc (GCC) 9.3.0
> 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
> git checkout 5a6f6f579178dbeb33002d93b4f646c31348fac9
> # save the attached .config to linux build tree
> COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross 
> ARCH=ia64
>
> If you fix the issue, kindly add following tag as appropriate
> Reported-by: kernel test robot 
>
> All errors (new ones prefixed by >>):
>
>    ia64-linux-ld: net/tipc/udp_media.o: in function `tipc_udp_enable':
> >> net/tipc/udp_media.c:743: undefined reference to `ipv6_dev_find'
To use some APIs exported from ipv6 code.
We need add this:

--- a/net/tipc/Kconfig
+++ b/net/tipc/Kconfig
@@ -6,6 +6,7 @@
 menuconfig TIPC
tristate "The TIPC Protocol"
depends on INET
+   depends on IPV6 || IPV6=n

>
> vim +743 net/tipc/udp_media.c
>
>642
>643  /**
>644   * tipc_udp_enable - callback to create a new udp bearer instance
>645   * @net:network namespace
>646   * @b:  pointer to generic tipc_bearer
>647   * @attrs:  netlink bearer configuration
>648   *
>649   * validate the bearer parameters and initialize the udp bearer
>650   * rtnl_lock should be held
>651   */
>652  static int tipc_udp_enable(struct net *net, struct tipc_bearer *b,
>653 struct nlattr *attrs[])
>654  {
>655  int err = -EINVAL;
>656  struct udp_bearer *ub;
>657  struct udp_media_addr remote = {0};
>658  struct udp_media_addr local = {0};
>659  struct udp_port_cfg udp_conf = {0};
>660  struct udp_tunnel_sock_cfg tuncfg = {NULL};
>661  struct nlattr *opts[TIPC_NLA_UDP_MAX + 1];
>662  u8 node_id[NODE_ID_LEN] = {0,};
>663  int rmcast = 0;
>664
>665  ub = kzalloc(sizeof(*ub), GFP_ATOMIC);
>666  if (!ub)
>667  return -ENOMEM;
>668
>669  INIT_LIST_HEAD(>rcast.list);
>670
>671  if (!attrs[TIPC_NLA_BEARER_UDP_OPTS])
>672  goto err;
>673
>674  if (nla_parse_nested_deprecated(opts, TIPC_NLA_UDP_MAX, 
> attrs[TIPC_NLA_BEARER_UDP_OPTS], tipc_nl_udp_policy, NULL))
>675  goto err;
>676
>677  if (!opts[TIPC_NLA_UDP_LOCAL] || !opts[TIPC_NLA_UDP_REMOTE]) {
>678  pr_err("Invalid UDP bearer configuration");
>679  err = -EINVAL;
>680  goto err;
>681  }
>682
>683  err = tipc_parse_udp_addr(opts[TIPC_NLA_UDP_LOCAL], ,
>684>ifindex);
>685  if (err)
>686  goto err;
>687
>688  err = tipc_parse_udp_addr(opts[TIPC_NLA_UDP_REMOTE], , 
> NULL);
>689  if (err)
>690  goto err;
>691
>692  if (remote.proto != local.proto) {
>693  err = -EINVAL;
>694  goto err;
>695  }
>696
>697  /* Checking remote ip address */
>698  rmcast = tipc_udp_is_mcast_addr();
>699
>700  /* Autoconfigure own node identity if needed */
>701  if (!tipc_own_id(net)) {
>702  memcpy(node_id, local.ipv6.in6_u.u6_addr8, 16);
>703  tipc_net_init(net, node_id, 0);
>704  }
>705  if (!tipc_own_id(net)) {
>706  pr_warn("Failed to set node id, please configure 
> manually\n");
>707  err = -EINVAL;
>708  goto err;
>709  }
>710
>711  b->bcast_addr.media_id = TIPC_MEDIA_TYPE_UDP;
>712  b->bcast_addr.broadcast = TIPC_BROADCAST_SUPPORT;
>713  rcu_assign_pointer(b->media_ptr, ub);
>714  rcu_assign_pointer(ub->bearer, b);
>715  tipc_udp_media_addr_set(>addr, );
>716  if (local.proto == htons(ETH_P_IP)) {
>717 

net/tipc/udp_media.c:743: undefined reference to `ipv6_dev_find'

2020-08-11 Thread kernel test robot
tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 
master
head:   c636eef2ee3696f261a35f34989842701a107895
commit: 5a6f6f579178dbeb33002d93b4f646c31348fac9 tipc: set ub->ifindex for 
local ipv6 address
date:   6 days ago
config: ia64-randconfig-r005-20200811 (attached as .config)
compiler: ia64-linux-gcc (GCC) 9.3.0
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
git checkout 5a6f6f579178dbeb33002d93b4f646c31348fac9
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross 
ARCH=ia64 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot 

All errors (new ones prefixed by >>):

   ia64-linux-ld: net/tipc/udp_media.o: in function `tipc_udp_enable':
>> net/tipc/udp_media.c:743: undefined reference to `ipv6_dev_find'

vim +743 net/tipc/udp_media.c

   642  
   643  /**
   644   * tipc_udp_enable - callback to create a new udp bearer instance
   645   * @net:network namespace
   646   * @b:  pointer to generic tipc_bearer
   647   * @attrs:  netlink bearer configuration
   648   *
   649   * validate the bearer parameters and initialize the udp bearer
   650   * rtnl_lock should be held
   651   */
   652  static int tipc_udp_enable(struct net *net, struct tipc_bearer *b,
   653 struct nlattr *attrs[])
   654  {
   655  int err = -EINVAL;
   656  struct udp_bearer *ub;
   657  struct udp_media_addr remote = {0};
   658  struct udp_media_addr local = {0};
   659  struct udp_port_cfg udp_conf = {0};
   660  struct udp_tunnel_sock_cfg tuncfg = {NULL};
   661  struct nlattr *opts[TIPC_NLA_UDP_MAX + 1];
   662  u8 node_id[NODE_ID_LEN] = {0,};
   663  int rmcast = 0;
   664  
   665  ub = kzalloc(sizeof(*ub), GFP_ATOMIC);
   666  if (!ub)
   667  return -ENOMEM;
   668  
   669  INIT_LIST_HEAD(>rcast.list);
   670  
   671  if (!attrs[TIPC_NLA_BEARER_UDP_OPTS])
   672  goto err;
   673  
   674  if (nla_parse_nested_deprecated(opts, TIPC_NLA_UDP_MAX, 
attrs[TIPC_NLA_BEARER_UDP_OPTS], tipc_nl_udp_policy, NULL))
   675  goto err;
   676  
   677  if (!opts[TIPC_NLA_UDP_LOCAL] || !opts[TIPC_NLA_UDP_REMOTE]) {
   678  pr_err("Invalid UDP bearer configuration");
   679  err = -EINVAL;
   680  goto err;
   681  }
   682  
   683  err = tipc_parse_udp_addr(opts[TIPC_NLA_UDP_LOCAL], ,
   684>ifindex);
   685  if (err)
   686  goto err;
   687  
   688  err = tipc_parse_udp_addr(opts[TIPC_NLA_UDP_REMOTE], , 
NULL);
   689  if (err)
   690  goto err;
   691  
   692  if (remote.proto != local.proto) {
   693  err = -EINVAL;
   694  goto err;
   695  }
   696  
   697  /* Checking remote ip address */
   698  rmcast = tipc_udp_is_mcast_addr();
   699  
   700  /* Autoconfigure own node identity if needed */
   701  if (!tipc_own_id(net)) {
   702  memcpy(node_id, local.ipv6.in6_u.u6_addr8, 16);
   703  tipc_net_init(net, node_id, 0);
   704  }
   705  if (!tipc_own_id(net)) {
   706  pr_warn("Failed to set node id, please configure 
manually\n");
   707  err = -EINVAL;
   708  goto err;
   709  }
   710  
   711  b->bcast_addr.media_id = TIPC_MEDIA_TYPE_UDP;
   712  b->bcast_addr.broadcast = TIPC_BROADCAST_SUPPORT;
   713  rcu_assign_pointer(b->media_ptr, ub);
   714  rcu_assign_pointer(ub->bearer, b);
   715  tipc_udp_media_addr_set(>addr, );
   716  if (local.proto == htons(ETH_P_IP)) {
   717  struct net_device *dev;
   718  
   719  dev = __ip_dev_find(net, local.ipv4.s_addr, false);
   720  if (!dev) {
   721  err = -ENODEV;
   722  goto err;
   723  }
   724  udp_conf.family = AF_INET;
   725  
   726  /* Switch to use ANY to receive packets from group */
   727  if (rmcast)
   728  udp_conf.local_ip.s_addr = htonl(INADDR_ANY);
   729  else
   730  udp_conf.local_ip.s_addr = local.ipv4.s_addr;
   731  udp_conf.use_udp_checksums = false;
   732  ub->ifindex = dev->ifindex;
   733  if (tipc_mtu_bad(dev, sizeof(struct iphdr) +
   7