[BusyBox 0002019]: zcip fails to obtain or defend an IP address when daemonized

bugs at busybox.net bugs at busybox.net
Mon Feb 4 09:40:26 UTC 2008


A NOTE has been added to this issue. 
====================================================================== 
http://busybox.net/bugs/view.php?id=2019 
====================================================================== 
Reported By:                dajhorn
Assigned To:                BusyBox
====================================================================== 
Project:                    BusyBox
Issue ID:                   2019
Category:                   Networking Support
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     assigned
====================================================================== 
Date Submitted:             01-30-2008 13:06 PST
Last Modified:              02-04-2008 01:40 PST
====================================================================== 
Summary:                    zcip fails to obtain or defend an IP address when
daemonized
Description: 
The busybox zcip program fails to obtain or defend an IP address when it is
started as a daemon because the bb_daemonize_or_rexec() function closes the
sock_fd.

Calling bb_daemonize_or_rexec() before opening the domain socket results
in proper behavior.
====================================================================== 

---------------------------------------------------------------------- 
 vda - 02-03-08 16:53  
---------------------------------------------------------------------- 
Why bb_daemonize_or_rexec() function closes the sock_fd?

It is calling bb_daemonize_or_rexec(), which should never
close any extra fds unless (flags & DAEMON_CLOSE_EXTRA_FDS) != 0.
In zcip case, DAEMON_CLOSE_EXTRA_FDS is not set.

I am confused. 

---------------------------------------------------------------------- 
 dajhorn - 02-03-08 17:46  
---------------------------------------------------------------------- 
This bug was first discussed when xdaemon() was replaced.  Perhaps it is a
regression.

http://www.uclibc.org/lists/busybox/2007-February.txt

When you try this patch, do you get different zcip behavior? 

---------------------------------------------------------------------- 
 vda - 02-04-08 01:40  
---------------------------------------------------------------------- 
No, I don't see the difference. I think I know why. bb_daemonize is
innocent. It's openlog! It opens new fd for logging, and if it happens to
be fd 3, it gets reused for sock_fd later. We must open ARP socket before
openlog.

http://busybox.net/downloads/fixes-1.9.0/busybox-1.9.0-zcip.patch

should fix it. Please test this patch. 

Issue History 
Date Modified   Username       Field                    Change               
====================================================================== 
01-30-08 13:06  dajhorn        New Issue                                    
01-30-08 13:06  dajhorn        Status                   new => assigned     
01-30-08 13:06  dajhorn        Assigned To               => BusyBox         
01-30-08 13:06  dajhorn        File Added: busybox-zcip-daemonize.patch         
          
02-03-08 16:53  vda            Note Added: 0003664                          
02-03-08 17:46  dajhorn        Note Added: 0003684                          
02-04-08 01:40  vda            Note Added: 0003694                          
======================================================================




More information about the busybox-cvs mailing list