[Bug 917905] Re: netcfg hang bug in autoconfig.c

Stéphane Graber stgraber at stgraber.org
Tue Jan 24 21:12:23 UTC 2012


Thanks for your bug report and patch. do a quick test and review of the
patch and if all looks good, apply it in Ubuntu and if it's common to
Debian, submit it there too.

** Changed in: netcfg (Ubuntu)
     Assignee: (unassigned) => Stéphane Graber (stgraber)

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to netcfg in Ubuntu.
https://bugs.launchpad.net/bugs/917905

Title:
  netcfg hang bug in autoconfig.c

Status in “netcfg” package in Ubuntu:
  Confirmed

Bug description:
  I am working on the Precise alpha (beta?) It appears there is a bug in
  netcfg's autoconfig.c.

  
  antarus at goats2 ~ $ rdisc6 eth0
  Soliciting ff02::2 (ff02::2) on eth0...

  Hop limit                 :           64 (      0x40)
  Stateful address conf.    :           No
  Stateful other conf.      :          Yes
  Router preference         :       medium
  Router lifetime           :         1800 (0x00000708) seconds
  Reachable time            :  unspecified (0x00000000)
  Retransmit time           :  unspecified (0x00000000)
   Source link-layer address: 00:05:73:A0:00:65
   MTU                      :         1500 bytes (valid)
   Prefix                   : 2620:0:1000:2800::/64
    Valid time              :      2592000 (0x00278d00) seconds
    Pref. time              :       604800 (0x00093a80) seconds
   from fe80::5:73ff:fea0:65

  We set Stateful Other conf which correctly tells netcfg to try dhcpv6.
  Sadly we don't have dhcpv6 set up yet, so dhclient will never receive a lease. netcfg/dhcpv6_timeout is normally set for 15s and this should only impose a minor delay for us (until we properly configure our network.) However due to a bug in netcfg_dhcpv6() it hangs forever instead.

  in netcfg_dhcpv6(...) 
          rv = poll_dhcpv6_client(client, interface);

          dhcpv6_reader = fdopen(dhcpv6_pipe[0], "r");
          while (fgets(l, sizeof(l), dhcpv6_reader) != NULL) {

  It looks like the code tries to read from dhcpv6_pipe which is the
  stdout of the dhclient process. However the client has not actually
  received any leases (since we don't run dhcpv6) so the output it is
  expecting will never happen and it will hang on the fgets() call. I
  think you should check the value of 'rv' to see if we actually got a
  lease. If we didn't then we shouldn't try to read from the pipe.

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/netcfg/+bug/917905/+subscriptions




More information about the foundations-bugs mailing list