#2185 closed enhancement (wontfix)
Check carrier status in DHCP client scripts
Reported by: | Owned by: | Bruce Dubbs | |
---|---|---|---|
Priority: | normal | Milestone: | |
Component: | Bootscripts | Version: | SVN |
Severity: | normal | Keywords: | network |
Cc: |
Description
Instead of blindly running dhcp and waiting for it to timeout, we can query whether the network card is attached to anything first through a couple methods. See further discussion here:
http://linuxfromscratch.org/pipermail/blfs-dev/2006-October/015767.html
Change History (15)
comment:1 by , 18 years ago
comment:2 by , 18 years ago
Milestone: | 6.2.0 → future |
---|---|
Status: | new → assigned |
Punting this for now. I like the idea, but I don't think we need to be toying with the network scripts at this stage in the game. Especially since I'm proposing it and it doesn't even work on my network card.
comment:3 by , 17 years ago
What is the status on this one? Seems a fairly simple modification as long as the /sys method tests reliably on several devices. Actually, come to think of it, this should probably be done in the ifup script in LFS. I'm not sure if this would affect Bruce's wireless scripts however. It'd have to wait until after the 6.3 release, but this or something similar looks well in my ifup (pardon the fake diff):
+ # Only process the config file if the device is actually connected
+ # to media.
+ if [ "cat /sys/class/net/${1}/carrier
" = 1 ]
+ then
- IFCONFIG=${file} ${NETWORK_DEVICES}/services/${SERVICE} ${1} up
+ IFCONFIG=${file} ${NETWORK_DEVICES}/services/${SERVICE} ${1} up + else + echo -e "${WARNING} The ${1} device has no connection!" + echo -en "${CURS_UP}" + log_warning_msg + fi
comment:4 by , 17 years ago
+ # Only process the config file if the device is actually connected + # to media. + if [ "`cat /sys/class/net/${1}/carrier`" = 1 ] + then - IFCONFIG=${file} ${NETWORK_DEVICES}/services/${SERVICE} ${1} up + IFCONFIG=${file} ${NETWORK_DEVICES}/services/${SERVICE} ${1} up + else + echo -e "${WARNING} The ${1} device has no connection!" + echo -en "${CURS_UP}" + log_warning_msg + fi
comment:5 by , 17 years ago
For wired connections, checking the carrier status works. For wireless connections, the carrier or "up" status is mostly useless. On one of my ethernet cards, the kernel driver doesn't update the carrier status. I have a bug open in the kernel bugzilla, but it hasn't been addressed.
In that case, the carrier is always 1, so there wouldn't be any regression as the network scripts would just carry on as they do now. Still, I think it would need some wider testing from people with various cards.
I think we should just put this in after 6.3 and let people report on how it works for them.
comment:6 by , 16 years ago
Milestone: | future → 6.4 |
---|---|
Owner: | changed from | to
Status: | assigned → new |
comment:7 by , 16 years ago
Component: | BOOK → Bootscripts |
---|
comment:11 by , 13 years ago
Milestone: | 6.7 → current |
---|
comment:12 by , 13 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
comment:13 by , 13 years ago
I know this is an old ticket, but don't know if we should fix it or not. First of all, the interface must be set 'up' before checking /sys/class/net/${1}/carrier, otherwise an error is returned. Secondly, I found that it takes about two seconds after the interface is set up for the carrier to change from 0 to 1 for a static IP on my system.
I really don't want want to but a sleep into the boot scripts.
We could make the check optional in ifconfig.eth0 with a variable like CHECK_CARRIER.
Also, I think this would only be applicable to wired connections.
I'd like to get feedback before continuing.
comment:14 by , 12 years ago
Resolution: | → wontfix |
---|---|
Status: | assigned → closed |
Making wontfix due to lack of feedback.
Will this method work for wifi network connections? I think there may be a lot of variation here in how this is handled. In my case, I created a script that links and establishes ath0 and then run a process to give the interface an ip address (fixed or dhcp). Its hard to determine in advance how someone will use a wifi connection. Perhaps a general discussion in the configuration section giving exaples of various options would be appropriate.