ALT Linux Bugzilla
– Attachment 5549 Details for
Bug 27669
Установка hostname
New bug
|
Search
|
[?]
|
Help
Register
|
Log In
[x]
|
Forgot Password
Login:
[x]
|
EN
|
RU
[patch]
запрос hostname и установка hostname и domainname
sethostname.patch (text/plain), 1.39 KB, created by
Michael A. Kangin
on 2012-08-25 16:32:08 MSK
(
hide
)
Description:
запрос hostname и установка hostname и domainname
Filename:
MIME Type:
Creator:
Michael A. Kangin
Created:
2012-08-25 16:32:08 MSK
Size:
1.39 KB
patch
obsolete
>diff --git a/dhcp.c b/dhcp.c >index f903340..a33d77f 100644 >--- a/dhcp.c >+++ b/dhcp.c >@@ -243,6 +243,11 @@ static void parse_reply(struct bootp_request * breq, struct interface_info * int > tmp_str[length] = '\0'; > domain = strdup(tmp_str); > log_message("got domain %s", domain); >+ if (setdomainname(domain, strlen(domain)) == 0) >+ log_message("set domain %s", domain); >+ else >+ log_message("could not set domain %s", domain); >+ > break; > > case BOOTP_OPTION_BROADCAST: >@@ -260,6 +265,11 @@ static void parse_reply(struct bootp_request * breq, struct interface_info * int > tmp_str[length] = '\0'; > hostname = strdup(tmp_str); > log_message("got hostname %s", hostname); >+ if (sethostname(hostname, strlen(hostname)) == 0) >+ log_message("set hostname %s", hostname); >+ else >+ log_message("could not set hostname %s", hostname); >+ > break; > > case BOOTP_OPTION_ROOTPATH: >@@ -591,6 +601,7 @@ enum return_type perform_dhcp(struct interface_info * intf) > requested_options[num_options++] = BOOTP_OPTION_GATEWAY; > requested_options[num_options++] = BOOTP_OPTION_DNS; > requested_options[num_options++] = BOOTP_OPTION_DOMAIN; >+ requested_options[num_options++] = BOOTP_OPTION_HOSTNAME; > requested_options[num_options++] = BOOTP_OPTION_ROOTPATH; > requested_options[num_options++] = BOOTP_OPTION_BROADCAST; > add_vendor_code(&breq, DHCP_OPTION_OPTIONREQ, num_options, requested_options);
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 27669
: 5549