entsprechende Diskussion/Thread:
http://forum.tuxbox-cvs.sourceforge.net ... hp?t=41809
... dieses kleine Feature noch, dann fuktioniert der DHCP-Client perfekt.

tom_22
Code: Alles auswählen
RCS file: /cvs/tuxbox/apps/misc/libs/libnet/network_interfaces.cpp,v
retrieving revision 1.6
diff -u -r1.6 network_interfaces.cpp
--- a/network_interfaces.cpp 20 Mar 2003 15:32:52 -0000 1.6
+++ b/network_interfaces.cpp 12 Jul 2006 19:57:48 -0000
@@ -369,5 +369,13 @@
{
std::map<std::string, std::string> attribute;
+ std::string hostname = "";
+ std::ifstream in("/etc/hostname", std::ifstream::in);
+
+ if (in.is_open()) {
+ in >> hostname ;
+ if (hostname != "") attribute["hostname"] = hostname;
+ }
+
return write_interface("/etc/network/interfaces", name, automatic_start, "inet", "dhcp", attribute);
}
Code: Alles auswählen
int gethostname(char *name, size_t len);
Code: Alles auswählen
RCS file: /cvs/tuxbox/apps/misc/libs/libnet/network_interfaces.cpp,v
retrieving revision 1.6
diff -u -r1.6 network_interfaces.cpp
--- a/network_interfaces.cpp 20 Mar 2003 15:32:52 -0000 1.6
+++ b/network_interfaces.cpp 13 Jul 2006 19:58:07 -0000
@@ -368,6 +368,12 @@
bool setDhcpAttributes(const std::string name, const bool automatic_start)
{
std::map<std::string, std::string> attribute;
+ const size_t max_hostname_len = 128;
+ char hostname[max_hostname_len];
+
+ if (gethostname(hostname, max_hostname_len) == 0) {
+ attribute["hostname"] = (std::string)hostname;
+ }
return write_interface("/etc/network/interfaces", name, automatic_start, "inet", "dhcp", attribute);
}
Code: Alles auswählen
houdini 06/07/28 23:27:57
Modified: misc/libs/libnet network_interfaces.cpp
Log:
Now sends its hostname with DHCP request, see
http://forum.tuxbox.org/forum/viewtopic.php?p=305213#305213
Revision Changes Path
1.7 +7 -1 apps/misc/libs/libnet/network_interfaces.cpp
file : http://cvs.tuxbox.org/tuxbox/apps/misc/libs/libnet/network_interfaces.cpp?rev=1.7&content-type=text/vnd.viewcvs-markup
plain: http://cvs.tuxbox.org/tuxbox/apps/misc/libs/libnet/network_interfaces.cpp?rev=1.7&content-type=text/plain
revision graph: http://cvs.tuxbox.org/tuxbox/apps/misc/libs/libnet/network_interfaces.cpp?graph=1.7
diff : http://cvs.tuxbox.org/tuxbox/apps/misc/libs/libnet/network_interfaces.cpp.diff?r1=1.6&r2=1.7
Index: network_interfaces.cpp
Code: Alles auswählen
/bin/hostname blah
Jo,Houdini hat geschrieben:stimmt.
Abhilfe:
du rufst später nochmal irgendwoaufCode: Alles auswählen
/bin/hostname blah
oder /etc/hostname wird ein link auf var/etc/hostname
stimmt.aber das später aufrufen bringt dann dem dhcp server nichts mehr.
Auf dem Router müsste ein DNS-Server laufen, dort musst DuPT-1 hat geschrieben:aber der Router bekommt davon nichts mit.
gar nicht solange du nicht auf der Dbox2 Samba installierst. Nur ein Sambaserver ist unter Linux in der Lage sich unter Windows Netzwerkumgebungen anzeigen zu lassen. Gibt es aber für die Dbox nichtwie kann ich denn meine Dboxen im Netz mit Namen anzeigen lassen..?
das kann man so nicht stehenlassen..alex12555 hat geschrieben:...Nur ein Sambaserver ist unter Linux in der Lage sich unter Windows Netzwerkumgebungen anzeigen zu lassen. Gibt es aber für die Dbox nicht ...
*patsch hatte ich ja ganz vergessendas kann man so nicht stehenlassen..--enable-sambaserver