Created attachment 251854 [details] ignore_SIP_servers_dhcp_option.patch My router NSD-G1000T made by SONY sends SIP servers DHCP option (120) in the DHCP response and dhclient(8) warns a message 'unknown dhcp option value 0x78'. It's annoying to me. The SIP servers DHCP option isn't needed to handle anything. The attached patch shuts up the warning message.
This looks totally reasonable
(In reply to Yuichiro NAITO from comment #0) Have you tried ignoring the option in /etc/dhclient.conf (see dhclient.conf(5)). Not a big fan of the patch.
(In reply to Jose Luis Duran from comment #2) Can you explain why you don't like the patch?
(In reply to Michael Osipov from comment #3) I think the code does the right thing. The problem is silencing the logs, which is why I suggested to add the ignore statement to /etc/dhclient.conf. Otherwise, we would end up removing all the options that return 1, if SONY decides to send them as well.
I apologize. I read the patch as if the option was being removed. I agree and accept the patch.
(In reply to Jose Luis Duran from comment #2) > Have you tried ignoring the option in /etc/dhclient.conf (see dhclient.conf(5)). I tried `ignore option-120;` in my /etc/dhclient.conf. This configuration works for me to shut up the warning message. But I can't find the `option-120` option name without reading source codes. I'm happy if my patch is committed.
(In reply to Yuichiro NAITO from comment #6) I bet it is created on the fly with the prefix 'option-'. Did you search for that as well?
(In reply to Yuichiro NAITO from comment #6) tables.c you are looking for.
(In reply to Michael Osipov from comment #7) > I bet it is created on the fly with the prefix 'option-'. Did you search for that as well? If your 'search' means grep(1) or keyword search by a text editor, my answer is no. Printing the warning message is in the 'check_option' function. It is called from the option number loop in the `packet_to_lease` function. Each option number is checked if it is included in the ignored option list. The ignored option list is created by the configuration file parser. In the parser, the `parse_option_list` function parses an option name. This function looks up the `dhcp_options` table that lists all variable option names and option numbers. The table is written in 'table.c'.
(In reply to Yuichiro NAITO from comment #6) > But I can't find the `option-120` option name without reading source codes. You can find it in (the arguably outdated) dhcp-options(5): Options which are not listed by name may be defined by the name option-nnn, where nnn is the decimal number of the option code. While we are trying to move from dhclient to dhcpcd (probably), and the original upstream no longer supports dhclient, I think the patch is welcomed.
(In reply to Jose Luis Duran from comment #10) Oh, I missed the sentences. Thank you!
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=ac6dc5cde729a602252a0b80f82424861d2eb7b5 commit ac6dc5cde729a602252a0b80f82424861d2eb7b5 Author: Yuichiro NAITO <naito.yuichiro@gmail.com> AuthorDate: 2024-07-04 07:57:02 +0000 Commit: Michael Osipov <michaelo@FreeBSD.org> CommitDate: 2024-07-15 17:42:17 +0000 dhclient: Ignore SIP servers DHCP option defined in RFC 3361 Ignore SIP servers dhcp option to shut up the warning message. This option is defined in the RFC 3361 and sent from NSD-G1000T router. PR: 280119 Reviewed by: jrm (mentor), brooks MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D45873 sbin/dhclient/dhclient.c | 1 + sbin/dhclient/dhcp.h | 1 + 2 files changed, 2 insertions(+)
A commit in branch stable/14 references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=954692a144026860579cc525b5aa824b75719d6a commit 954692a144026860579cc525b5aa824b75719d6a Author: Yuichiro NAITO <naito.yuichiro@gmail.com> AuthorDate: 2024-07-04 07:57:02 +0000 Commit: Michael Osipov <michaelo@FreeBSD.org> CommitDate: 2024-07-29 06:19:41 +0000 dhclient: Ignore SIP servers DHCP option defined in RFC 3361 Ignore SIP servers dhcp option to shut up the warning message. This option is defined in the RFC 3361 and sent from NSD-G1000T router. PR: 280119 Reviewed by: jrm (mentor), brooks MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D45873 (cherry picked from commit ac6dc5cde729a602252a0b80f82424861d2eb7b5) sbin/dhclient/dhclient.c | 1 + sbin/dhclient/dhcp.h | 1 + 2 files changed, 2 insertions(+)
A commit in branch stable/13 references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=e5236f64051056eb933c6a53f6f6c2bab62f308a commit e5236f64051056eb933c6a53f6f6c2bab62f308a Author: Yuichiro NAITO <naito.yuichiro@gmail.com> AuthorDate: 2024-07-04 07:57:02 +0000 Commit: Michael Osipov <michaelo@FreeBSD.org> CommitDate: 2024-07-29 06:21:34 +0000 dhclient: Ignore SIP servers DHCP option defined in RFC 3361 Ignore SIP servers dhcp option to shut up the warning message. This option is defined in the RFC 3361 and sent from NSD-G1000T router. PR: 280119 Reviewed by: jrm (mentor), brooks MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D45873 (cherry picked from commit ac6dc5cde729a602252a0b80f82424861d2eb7b5) sbin/dhclient/dhclient.c | 1 + sbin/dhclient/dhcp.h | 1 + 2 files changed, 2 insertions(+)