BusyBox Bug and Patch Tracking
BusyBox
  

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0002019 [BusyBox] Networking Support minor always 01-30-08 13:06 02-28-08 09:06
Reporter dajhorn View Status public  
Assigned To BusyBox
Priority normal Resolution unable to reproduce  
Status closed   Product Version svn
Summary 0002019: 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.
Additional Information This patch works for me in a BB_MMU environment, but it should be tested with NOMMU.
Attached Files  busybox-zcip-daemonize.patch [^] (1,130 bytes) 01-30-08 13:06

- Relationships

- Notes
(0003664)
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.
 
(0003684)
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?
 
(0003694)
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.
 
(0005514)
vda
02-28-08 09:06

Tested again - current svn seems to work.
 

- 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
02-28-08 09:06 vda Status assigned => closed
02-28-08 09:06 vda Note Added: 0005514
02-28-08 09:06 vda Resolution open => unable to reproduce


Copyright © 2000 - 2006 Mantis Group
Powered by Mantis Bugtracker