Date: Sat, 12 Jul 2008 17:05:25 +0300 From: "Niki Denev" <nike_d@cytexbg.com> To: "FreeBSD Current" <freebsd-current@freebsd.org> Subject: [PATCH] dhclient link timeout option Message-ID: <2e77fc10807120705ud76cea2g1cc634c3012df684@mail.gmail.com>
next in thread | raw e-mail | index | archive | help
------=_Part_39179_11444668.1215871525963 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Hello, I've noticed that when I have both my wired and wireless interfaces on my laptop enabled with DHCP, it is always started on boot, but if there is no cable plugged or known wifi ap, dhclient waits for 10 seconds for link for each interface and thus delaying the boot process by 20 seconds. (background_dhclient didn't help). So I've decided to add a link timeout option to dhclient to specify how long it should wait for link on startup, which seems to work pretty nicely in my setup. I hope others might find this useful too. Regards, Niki ------=_Part_39179_11444668.1215871525963 Content-Type: application/octet-stream; name=dhclient-linktimeout.patch Content-Transfer-Encoding: base64 X-Attachment-Id: f_fijvful80 Content-Disposition: attachment; filename=dhclient-linktimeout.patch ZGlmZiAtdXIgc2Jpbi9kaGNsaWVudC5vcmlnL2RoY2xpZW50Ljggc2Jpbi9kaGNsaWVudC9kaGNs aWVudC44Ci0tLSBzYmluL2RoY2xpZW50Lm9yaWcvZGhjbGllbnQuOAkyMDA4LTA3LTEyIDA5OjQw OjM5LjAwMDAwMDAwMCArMDMwMAorKysgc2Jpbi9kaGNsaWVudC9kaGNsaWVudC44CTIwMDgtMDct MTIgMDk6NTM6MTcuMDAwMDAwMDAwICswMzAwCkBAIC04Myw2ICs4Myw4IEBACiBTcGVjaWZ5IGFu IGFsdGVybmF0ZSBsb2NhdGlvbiwKIC5BciBmaWxlICwKIGZvciB0aGUgbGVhc2VzIGZpbGUuCisu SXQgRmwgdCBBciB0aW1lb3V0CitTcGVjaWZ5IGhvdyBtYW55IHNlY29uZHMgdG8gd2FpdCBmb3Ig bGluay4KIC5JdCBGbCBxCiBGb3JjZXMKIC5ObQpkaWZmIC11ciBzYmluL2RoY2xpZW50Lm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aW5rX3RpbWVvdXQgPCAwKQorCQkJICAgbGlua190aW1lb3V0ID0gMDsKKwkJCWlmIChs aW5rX3RpbWVvdXQgPiAxMCkKKwkJCSAgIGxpbmtfdGltZW91dCA9IDEwOworCQkJYnJlYWs7CiAJ CWNhc2UgJ3UnOgogCQkJdW5rbm93bl9vayA9IDA7CiAJCQlicmVhazsKQEAgLTM3OCw3ICszODYs NyBAQAogCQl3aGlsZSAoIWludGVyZmFjZV9saW5rX3N0YXR1cyhpZmktPm5hbWUpKSB7CiAJCQlm cHJpbnRmKHN0ZGVyciwgIi4iKTsKIAkJCWZmbHVzaChzdGRlcnIpOwotCQkJaWYgKCsraSA+IDEw KSB7CisJCQlpZiAoKytpID4gbGlua190aW1lb3V0KSB7CiAJCQkJZnByaW50ZihzdGRlcnIsICIg Z2l2aW5nIHVwXG4iKTsKIAkJCQlleGl0KDEpOwogCQkJfQpAQCAtNDU1LDcgKzQ2Myw4IEBACiAJ ZXh0ZXJuIGNoYXIJKl9fcHJvZ25hbWU7CiAKIAlmcHJpbnRmKHN0ZGVyciwgInVzYWdlOiAlcyBb LWJkcXVdICIsIF9fcHJvZ25hbWUpOwotCWZwcmludGYoc3RkZXJyLCAiWy1jIGNvbmZmaWxlXSBb LWwgbGVhc2VmaWxlXSBpbnRlcmZhY2VcbiIpOworCWZwcmludGYoc3RkZXJyLCAiWy10IGxpbmsg dGltZW91dF0gWy1jIGNvbmZmaWxlXSAiKTsKKwlmcHJpbnRmKHN0ZGVyciwgIlstbCBsZWFzZWZp bGVdIGludGVyZmFjZVxuIik7CiAJZXhpdCgxKTsKIH0KIAo= ------=_Part_39179_11444668.1215871525963--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?2e77fc10807120705ud76cea2g1cc634c3012df684>