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
0001122 [BusyBox] Networking Support minor always 12-17-06 12:10 01-17-07 15:47
Reporter espakman View Status public  
Assigned To BusyBox
Priority normal Resolution fixed  
Status closed   Product Version
Summary 0001122: ifupdown on non-existent interface segfaults, busybox-1.3
Description When running ifup on a non-existent interface (but configured in /etc/network/interfaces) gives a segfault. Revision 16646 seems to introduce the segfault.
Additional Information
Attached Files  c.patch [^] (17,300 bytes) 12-18-06 13:00
 ifupdown.c [^] (31,436 bytes) 12-19-06 14:06

- Relationships

- Notes
(0001877)
vda
12-18-06 11:57

Show your /etc/network/interfaces please.
 
(0001878)
vda
12-18-06 13:00

Try attached c.patch and let us know whether that works
 
(0001879)
vda
12-18-06 13:02

c.patch applied in rev 16994, waiting for feedback
 
(0001886)
espakman
12-19-06 11:52

The segfault is gone, but now the following message is displayed on every interface:
"ifup: don't see to have all variables for ethx/inet"
(x is 0, 1, ..)

I think it's because of the "[[ ip ....%gateway% ]]". Removed extra spaces w/o checking" change. But haven't tested it yet.
 
(0001887)
espakman
12-19-06 12:37

Just tested and the "don't seem to have all variables" problem is not gone with reverting the "Removed extra spaces w/o checking" part (although I'm not sure why you did that).
 
(0001888)
vda
12-19-06 12:42

>(although I'm not sure why you did that)

Because there is no reason why we should issue " ip ... " with leading space, I think.

Show your /etc/network/interfaces. Please.
 
(0001889)
espakman
12-19-06 12:46

My /etc/network/interfaces file:

# Loopback interface.
auto lo
iface lo inet loopback

# dhcp
auto eth0
iface eth0 inet dhcp

# fixed
auto eth1
iface eth1 inet static
    address 192.168.1.254
    netmask 255.255.255.0
    broadcast 192.168.1.255
 
(0001890)
bernhardf
12-19-06 13:29

1) add -a in the commands below, if you specify it please.
Just curious as to what libc are you using?
$ ifdown -v
$ ifup -v
 
(0001891)
espakman
12-19-06 14:05

> Just curious as to what libc are you using?

Using uClibc-0.9.28

> $ ifdown -va
> $ ifup -v

I have to run it in Qemu, running it on my router will bring my connection down and hard to repair (have to switch busybox too..). I will give the differences in output between busybox-1.2.2.1 and 1.3.0 + your ifupdown patch.

ifdown -va
with 1.3.0:
....
ip addr flush dev eth1
Nothing to flush.
ip link set eth1 down

with 1.2.2.1:
ip addr flush dev eth1
ip link set eth1 down

ifup -va
with 1.3.0:
......
ifup: don't seem to have all the variables for eth1/inet

with 1.2.2.1:
......
run-parts /etc/network/if-pre-up.d
ip addr add 192.168.1.254/24 broadcast 192.168.1.255 dev eth1 label eth1
ip link set eth1 up

run-parts /etc/network/if-up.d


The /etc/network/interfaces file is exactly the same in both cases.
 
(0001892)
vda
12-19-06 14:06

Hmmm.... indeed. Looks like parse() returning "" and returning NULL actually means different things! Attached (possibly fixed) ifup comes further on my system:

# ./ifup eth1
run-parts: cannot open '/etc/network/if-pre-up.d': No such file or directory

Please test-and-report and/or send me your entire /etc/network/*.
 
(0001893)
espakman
12-19-06 14:24

Still the same problem:

ifup: don't seem to have all the variables for eth1/inet

The contents of my /etc/network/ directory:
if-down.d/
if-post-down.d/
if-pre-up.d/
if-up.d/
interfaces

For testing the if-* directories contains no files.
 
(0001894)
vda
12-19-06 15:00

I created empty directories and renamed eth1 to if (my real ethernet iface name). Then:

# ifup -vn if
run-parts /etc/network/if-pre-up.d
ip addr add 192.168.1.254/24 dev if label if
ip link set if up

run-parts /etc/network/if-up.d

# ifup -v if
run-parts /etc/network/if-pre-up.d
ip addr add 192.168.1.254/24 dev if label if
ip link set if up

run-parts /etc/network/if-up.d

# ip a
1: lo: <LOOPBACK,UP,10000> mtu 16436 qdisc noqueue
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
2: if: <BROADCAST,MULTICAST,UP,10000> mtu 1500 qdisc pfifo_fast qlen 1000
    link/ether 00:16:17:6d:77:db brd ff:ff:ff:ff:ff:ff
    inet 192.168.1.111/24 brd 192.168.1.255 scope global if
    inet 192.168.1.254/24 scope global secondary if

So it works for me with /etc/network exactly as yours. I also double-checked that I really use ifupdown.c like one attached on this page.
 
(0001897)
espakman
12-19-06 23:50

My latest tests also indicate that, when using 1 interface. When using two interfaces eth0 and eth1 (and loopback) the "don't seem to have all variables" message showed up on the second physical interface (busybox 1.3.0, not with 1.2.2.1).

I don't have the tools at the moment to doublecheck, will do that this evening (UTC).
 
(0001898)
espakman
12-20-06 11:59
edited on: 12-22-06 00:00

I doublechecked and recompiled and it's indeed working correct now! Thanks!

This bug can be closed.

 
(0001991)
jonlar
01-15-07 00:53

Please apply the fix for this bug in busybox_1_3_stable branch and provide a patch in http://busybox.net/downloads/fixes-1.3.1/ [^]

I had to use ifupdown.c from the trunk (r17011) to get ifup to work with busybox 1.3.1.
 

- Issue History
Date Modified Username Field Change
12-17-06 12:10 espakman New Issue
12-17-06 12:10 espakman Status new => assigned
12-17-06 12:10 espakman Assigned To  => BusyBox
12-18-06 11:57 vda Note Added: 0001877
12-18-06 13:00 vda File Added: c.patch
12-18-06 13:00 vda Note Added: 0001878
12-18-06 13:02 vda Note Added: 0001879
12-18-06 14:52 vda Status assigned => feedback
12-19-06 11:52 espakman Note Added: 0001886
12-19-06 12:37 espakman Note Added: 0001887
12-19-06 12:42 vda Note Added: 0001888
12-19-06 12:46 espakman Note Added: 0001889
12-19-06 13:29 bernhardf Note Added: 0001890
12-19-06 14:05 espakman Note Added: 0001891
12-19-06 14:06 vda Note Added: 0001892
12-19-06 14:06 vda File Added: ifupdown.c
12-19-06 14:24 espakman Note Added: 0001893
12-19-06 15:00 vda Note Added: 0001894
12-19-06 23:50 espakman Note Added: 0001897
12-20-06 11:59 espakman Note Added: 0001898
12-22-06 00:00 espakman Note Edited: 0001898
01-15-07 00:53 jonlar Note Added: 0001991
01-17-07 15:47 vda Status feedback => closed
01-17-07 15:47 vda Resolution open => fixed


Copyright © 2000 - 2006 Mantis Group
Powered by Mantis Bugtracker