Bug 280119 - dhclient: Ignore SIP servers dhcp option defined in RFC 3361
Summary: dhclient: Ignore SIP servers dhcp option defined in RFC 3361
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Only Me
Assignee: Michael Osipov
URL: https://reviews.freebsd.org/D45873
Keywords:
Depends on:
Blocks:
 
Reported: 2024-07-04 01:19 UTC by Yuichiro NAITO
Modified: 2024-09-21 02:01 UTC (History)
2 users (show)

See Also:


Attachments
ignore_SIP_servers_dhcp_option.patch (1.04 KB, text/plain)
2024-07-04 01:19 UTC, Yuichiro NAITO
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Yuichiro NAITO 2024-07-04 01:19:25 UTC
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.
Comment 1 Michael Osipov freebsd_committer freebsd_triage 2024-07-04 18:12:03 UTC
This looks totally reasonable
Comment 2 Jose Luis Duran freebsd_committer freebsd_triage 2024-07-04 18:22:32 UTC
(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.
Comment 3 Michael Osipov freebsd_committer freebsd_triage 2024-07-04 18:28:17 UTC
(In reply to Jose Luis Duran from comment #2)

Can you explain why you don't like the patch?
Comment 4 Jose Luis Duran freebsd_committer freebsd_triage 2024-07-04 18:38:51 UTC
(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.
Comment 5 Jose Luis Duran freebsd_committer freebsd_triage 2024-07-04 22:46:17 UTC
I apologize. I read the patch as if the option was being removed.

I agree and accept the patch.
Comment 6 Yuichiro NAITO 2024-07-05 00:31:22 UTC
(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.
Comment 7 Michael Osipov freebsd_committer freebsd_triage 2024-07-05 06:59:01 UTC
(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?
Comment 8 Michael Osipov freebsd_committer freebsd_triage 2024-07-05 07:21:33 UTC
(In reply to Yuichiro NAITO from comment #6)
tables.c you are looking for.
Comment 9 Yuichiro NAITO 2024-07-05 08:45:36 UTC
(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'.
Comment 10 Jose Luis Duran freebsd_committer freebsd_triage 2024-07-05 12:57:13 UTC
(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.
Comment 11 Yuichiro NAITO 2024-07-05 14:56:00 UTC
(In reply to Jose Luis Duran from comment #10)
Oh, I missed the sentences. Thank you!
Comment 12 commit-hook freebsd_committer freebsd_triage 2024-07-15 17:44:40 UTC
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(+)
Comment 13 commit-hook freebsd_committer freebsd_triage 2024-07-29 06:20:59 UTC
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(+)
Comment 14 commit-hook freebsd_committer freebsd_triage 2024-07-29 06:23:00 UTC
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(+)