Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

net: ipconfig: Remove outdated comment and indent code block

The comment has been around ever since commit 1da177e4c3f4
("Linux-2.6.12-rc2") and can be removed. Remove it and indent the code
block accordingly.

Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
Link: https://patch.msgid.link/20260109121128.170020-2-thorsten.blum@linux.dev
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Thorsten Blum and committed by
Jakub Kicinski
e405b3c9 d2f59bf9

+41 -46
+41 -46
net/ipv4/ipconfig.c
··· 679 679 static void __init 680 680 ic_dhcp_init_options(u8 *options, struct ic_device *d) 681 681 { 682 - u8 mt = ((ic_servaddr == NONE) 683 - ? DHCPDISCOVER : DHCPREQUEST); 682 + static const u8 ic_req_params[] = { 683 + 1, /* Subnet mask */ 684 + 3, /* Default gateway */ 685 + 6, /* DNS server */ 686 + 12, /* Host name */ 687 + 15, /* Domain name */ 688 + 17, /* Boot path */ 689 + 26, /* MTU */ 690 + 40, /* NIS domain name */ 691 + 42, /* NTP servers */ 692 + }; 693 + u8 mt = (ic_servaddr == NONE) ? DHCPDISCOVER : DHCPREQUEST; 684 694 u8 *e = options; 685 695 int len; 686 696 ··· 715 705 e += 4; 716 706 } 717 707 718 - /* always? */ 719 - { 720 - static const u8 ic_req_params[] = { 721 - 1, /* Subnet mask */ 722 - 3, /* Default gateway */ 723 - 6, /* DNS server */ 724 - 12, /* Host name */ 725 - 15, /* Domain name */ 726 - 17, /* Boot path */ 727 - 26, /* MTU */ 728 - 40, /* NIS domain name */ 729 - 42, /* NTP servers */ 730 - }; 708 + *e++ = 55; /* Parameter request list */ 709 + *e++ = sizeof(ic_req_params); 710 + memcpy(e, ic_req_params, sizeof(ic_req_params)); 711 + e += sizeof(ic_req_params); 731 712 732 - *e++ = 55; /* Parameter request list */ 733 - *e++ = sizeof(ic_req_params); 734 - memcpy(e, ic_req_params, sizeof(ic_req_params)); 735 - e += sizeof(ic_req_params); 736 - 737 - if (ic_host_name_set) { 738 - *e++ = 12; /* host-name */ 739 - len = strlen(utsname()->nodename); 740 - *e++ = len; 741 - memcpy(e, utsname()->nodename, len); 742 - e += len; 743 - } 744 - if (*vendor_class_identifier) { 745 - pr_info("DHCP: sending class identifier \"%s\"\n", 746 - vendor_class_identifier); 747 - *e++ = 60; /* Class-identifier */ 748 - len = strlen(vendor_class_identifier); 749 - *e++ = len; 750 - memcpy(e, vendor_class_identifier, len); 751 - e += len; 752 - } 753 - len = strlen(dhcp_client_identifier + 1); 754 - /* the minimum length of identifier is 2, include 1 byte type, 755 - * and can not be larger than the length of options 756 - */ 757 - if (len >= 1 && len < 312 - (e - options) - 1) { 758 - *e++ = 61; 759 - *e++ = len + 1; 760 - memcpy(e, dhcp_client_identifier, len + 1); 761 - e += len + 1; 762 - } 713 + if (ic_host_name_set) { 714 + *e++ = 12; /* host-name */ 715 + len = strlen(utsname()->nodename); 716 + *e++ = len; 717 + memcpy(e, utsname()->nodename, len); 718 + e += len; 719 + } 720 + if (*vendor_class_identifier) { 721 + pr_info("DHCP: sending class identifier \"%s\"\n", 722 + vendor_class_identifier); 723 + *e++ = 60; /* Class-identifier */ 724 + len = strlen(vendor_class_identifier); 725 + *e++ = len; 726 + memcpy(e, vendor_class_identifier, len); 727 + e += len; 728 + } 729 + len = strlen(dhcp_client_identifier + 1); 730 + /* the minimum length of identifier is 2, include 1 byte type, 731 + * and can not be larger than the length of options 732 + */ 733 + if (len >= 1 && len < 312 - (e - options) - 1) { 734 + *e++ = 61; 735 + *e++ = len + 1; 736 + memcpy(e, dhcp_client_identifier, len + 1); 737 + e += len + 1; 763 738 } 764 739 765 740 *e++ = 255; /* End of the list */