Bug 2035 - клиент DHCP не берет адрес если в машине 2 сетевые карты
Summary: клиент DHCP не берет адрес если в машине 2 сетевые карты
Status: CLOSED FIXED
Alias: None
Product: Sisyphus
Classification: Development
Component: dhcp-client (show other bugs)
Version: unstable
Hardware: all Linux
: P4 minor
Assignee: Grigory Milev
QA Contact:
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-01-22 14:15 MSK by Igor Muratov
Modified: 2005-08-30 14:28 MSD (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Igor Muratov 2003-01-22 14:15:58 MSK
Информация о баге поступила от Oleg K. Artemjev &lt;<a href="mailto:olli@rbauto.ru&gt" target="_new">olli@rbauto.ru&gt</a>; Полное описание прилагается
---

---
Alt Linux Master 2.0 


[<a href="mailto:root@ws002" target="_new">root@ws002</a> root]# /sbin/dhcpcd eth0
[<a href="mailto:root@ws002" target="_new">root@ws002</a> root]# echo $?
0
[<a href="mailto:root@ws002" target="_new">root@ws002</a> root]# /sbin/dhcpcd eth1
[<a href="mailto:root@ws002" target="_new">root@ws002</a> root]# echo $?
1
[<a href="mailto:root@ws002" target="_new">root@ws002</a> root]# /etc/rc.d/init.d/network stop
Shutting down interface eth0:                                                                         [  OK  ]
Shutting down interface eth1:                                                                         [  OK  ]
[<a href="mailto:root@ws002" target="_new">root@ws002</a> root]# /sbin/dhcpcd eth1
[<a href="mailto:root@ws002" target="_new">root@ws002</a> root]# echo $?
0
[<a href="mailto:root@ws002" target="_new">root@ws002</a> root]# /sbin/dhcpcd eth0
[<a href="mailto:root@ws002" target="_new">root@ws002</a> root]# echo $?
1
[<a href="mailto:root@ws002" target="_new">root@ws002</a> root]# 

В /etc/sysconfig/network-scripts/if-up в этом кусочке 

if [ -n \&quot;$DYNCONFIG\&quot; ]; then
    echo -n \&quot;Determining IP information for $DEVICE via ${DHCP_CLIENT##*/}...\&quot;
    if $DHCP_CLIENT $DHCP_ARGS; then
    echo \&quot; done.\&quot;
    else
    echo \&quot; failed.\&quot;
    exit 1
    fi

конфликт с возвратом $? от dhcpcd &lt;interface&gt;.

[<a href="mailto:root@ws002" target="_new">root@ws002</a> root]# /etc/rc.d/init.d/network stop
Shutting down interface eth0:                                                                         [  OK  ]
Shutting down interface eth1:                                                                         [  OK  ]
[<a href="mailto:root@ws002" target="_new">root@ws002</a> root]# dhcpcd eth0
[<a href="mailto:root@ws002" target="_new">root@ws002</a> root]# echo $?
0
[<a href="mailto:root@ws002" target="_new">root@ws002</a> root]# dhcpcd eth1
[<a href="mailto:root@ws002" target="_new">root@ws002</a> root]# echo $?
1
[<a href="mailto:root@ws002" target="_new">root@ws002</a> root]# ifconfig 
eth0      Link encap:Ethernet  HWaddr 00:05:5D:28:3C:AE  
          inet addr:192.168.200.2  Bcast:192.168.200.255  Mask:255.255.255.0
          UP BROADCAST NOTRAILERS RUNNING  MTU:1500  Metric:1
          RX packets:4067 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1170 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 
          RX bytes:1494436 (1.4 Mb)  TX bytes:117127 (114.3 Kb)

eth1      Link encap:Ethernet  HWaddr 00:C0:DF:09:20:9D  
          UP BROADCAST NOTRAILERS RUNNING  MTU:1500  Metric:1
          RX packets:6632 errors:0 dropped:0 overruns:0 frame:0
          TX packets:925 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 
          RX bytes:1977332 (1.8 Mb)  TX bytes:63176 (61.6 Kb)

[<a href="mailto:root@ws002" target="_new">root@ws002</a> root]# 

Таким образом баг в самом dhcpcd который не отрабатывает корректно ситуацию с двумя картами.

[<a href="mailto:root@ws002" target="_new">root@ws002</a> root]# strace /sbin/dhcpcd eth1 2&gt; /tmp/dcpcd.strace
[<a href="mailto:root@ws002" target="_new">root@ws002</a> root]# cat /tmp/dcpcd.strace
execve(\&quot;/sbin/dhcpcd\&quot;, [\&quot;/sbin/dhcpcd\&quot;, \&quot;eth1\&quot;], [/* 44 vars */]) = 0
uname({sys=\&quot;Linux\&quot;, node=\&quot;ws002\&quot;, ...}) = 0
brk(0)                                  = 0x8051754
open(\&quot;/etc/ld.so.preload\&quot;, O_RDONLY)    = -1 ENOENT (No such file or directory)
open(\&quot;/etc/ld.so.cache\&quot;, O_RDONLY)      = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=117420, ...}) = 0
old_mmap(NULL, 117420, PROT_READ, MAP_PRIVATE, 3, 0) = 0x2aabf000
close(3)                                = 0
open(\&quot;/lib/libc.so.6\&quot;, O_RDONLY)        = 3
read(3, \&quot;\\177ELF\\1\\1\\1\\0\\0\\0\\0\\0\\0\\0\\0\\0\\3\\0\\3\\0\\1\\0\\0\\0000\\210\&quot;..., 1024) = 1024
fstat64(3, {st_mode=S_IFREG|0755, st_size=5752480, ...}) = 0
old_mmap(NULL, 1264224, PROT_READ|PROT_EXEC, MAP_PRIVATE, 3, 0) = 0x2aadc000
mprotect(0x2ac07000, 39520, PROT_NONE)  = 0
old_mmap(0x2ac07000, 24576, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 3, 0x12a000) = 0x2ac07000
old_mmap(0x2ac0d000, 14944, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x2ac0d000
close(3)                                = 0
old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2ac11000
munmap(0x2aabf000, 117420)              = 0
getuid32()                              = 0
umask(022)                              = 022
open(\&quot;/var/run/dhcpcd-eth1.pid\&quot;, O_RDONLY) = -1 ENOENT (No such file or directory)
rt_sigaction(SIGHUP, NULL, {SIG_DFL}, 8) = 0
rt_sigaction(SIGHUP, {0x804a3c0, [], 0x4000000}, NULL, 8) = 0
rt_sigaction(SIGINT, {0x804a3c0, [], 0x4000000}, NULL, 8) = 0
rt_sigaction(SIGQUIT, {0x804a3c0, [], 0x4000000}, NULL, 8) = 0
rt_sigaction(SIGILL, {0x804a3c0, [], 0x4000000}, NULL, 8) = 0
rt_sigaction(SIGTRAP, {0x804a3c0, [], 0x4000000}, NULL, 8) = 0
rt_sigaction(SIGABRT, {0x804a3c0, [], 0x4000000}, NULL, 8) = 0
rt_sigaction(SIGBUS, {0x804a3c0, [], 0x4000000}, NULL, 8) = 0
rt_sigaction(SIGFPE, {0x804a3c0, [], 0x4000000}, NULL, 8) = 0
rt_sigaction(SIGKILL, {0x804a3c0, [], 0x4000000}, NULL, 8) = -1 EINVAL (Invalid argument)
rt_sigaction(SIGUSR1, {0x804a3c0, [], 0x4000000}, NULL, 8) = 0
rt_sigaction(SIGSEGV, {0x804a3c0, [], 0x4000000}, NULL, 8) = 0
rt_sigaction(SIGUSR2, {0x804a3c0, [], 0x4000000}, NULL, 8) = 0
rt_sigaction(SIGPIPE, {0x804a3c0, [], 0x4000000}, NULL, 8) = 0
rt_sigaction(SIGALRM, {0x804a3c0, [], 0x4000000}, NULL, 8) = 0
rt_sigaction(SIGTERM, {0x804a3c0, [], 0x4000000}, NULL, 8) = 0
rt_sigaction(SIGCHLD, {0x804a3c0, [], 0x4000000}, NULL, 8) = 0
alarm(60)                               = 0
socket(PF_PACKET, SOCK_PACKET, 768)     = 3
ioctl(3, 0x8927, 0x7ffff760)            = 0
setsockopt(3, SOL_SOCKET, SO_BROADCAST, [1], 4) = 0
ioctl(3, 0x8914, 0x7ffff760)            = 0
ioctl(3, 0x8927, 0x7ffff760)            = 0
setsockopt(3, SOL_SOCKET, SO_BROADCAST, [1], 4) = 0
ioctl(3, 0x8914, 0x7ffff760)            = 0
bind(3, {sin_family=AF_PACKET, proto=0x6574, if12648, pkttype=0, addr(0)={0, }, 16) = 0
time(NULL)                              = 1043241962
socket(PF_INET, SOCK_DGRAM, IPPROTO_IP) = 4
setsockopt(4, SOL_SOCKET, SO_BROADCAST, [1], 4) = 0
bind(4, {sin_family=AF_INET, sin_port=htons(68), sin_addr=inet_addr(\&quot;0.0.0.0\&quot;)}}, 16) = -1 EADDRINUSE (Address already in use)
brk(0)                                  = 0x8051754
brk(0x80518e4)                          = 0x80518e4
brk(0x8052000)                          = 0x8052000
brk(0x8055000)                          = 0x8055000
time([1043241962])                      = 1043241962
open(\&quot;/etc/localtime\&quot;, O_RDONLY)        = 5
fstat64(5, {st_mode=S_IFREG|0644, st_size=815, ...}) = 0
old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2aabf000
read(5, \&quot;TZif\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\f\\0\\0\\0\\f\\0\&quot;..., 4096) = 815
close(5)                                = 0
munmap(0x2aabf000, 4096)                = 0
getpid()                                = 10047
rt_sigaction(SIGPIPE, {0x2abbed90, [], 0x4000000}, {0x804a3c0, [], 0x4000000}, 8) = 0
socket(PF_UNIX, SOCK_DGRAM, 0)          = 5
fcntl64(5, F_SETFD, FD_CLOEXEC)         = 0
connect(5, {sin_family=AF_UNIX, path=\&quot;/dev/log\&quot;}, 16) = 0
send(5, \&quot;&lt;131&gt;Jan 22 16:26:02 dhcpcd[1004\&quot;..., 76, 0) = 76
rt_sigaction(SIGPIPE, {0x804a3c0, [], 0x4000000}, NULL, 8) = 0
_exit(1)                                = ?

Comment 1 Grigory Milev 2004-07-22 09:20:20 MSD
fixed