Report information
The Basics
Id:
44535
Status:
resolved
Estimated:
32 hours (1,920 minutes)
Priority:
Low/Low
Queue:

BugTracker
Version Fixed:
4.4.0
Version Found:
(no value)
Versions Affected:
(no value)
Versions Planned:
4.4.0
Priority:
P2 Normal
Severity:
(no value)
CVSS Score:
(no value)
CVE ID:
(no value)
Component:
(no value)
Area:
(no value)

Attachments
ATT00001.txt ATT00005.htm ATT00006.htm dhcp-relayport-tests.txt relayport-server-v6-patch.txt Show all

Dates
Created:Thu, 26 Jan 2017 05:52:14 -0500
Updated:Wed, 03 Jan 2018 07:02:55 -0500
Closed:Wed, 03 Jan 2018 07:02:54 -0500



This bug tracker is no longer active.

Please go to our Gitlab to submit issues (both feature requests and bug reports) for active projects maintained by Internet Systems Consortium (ISC).

Due to security and confidentiality requirements, full access is limited to the primary maintainers.

Subject: Patch: DHCP relay port feature code for review (from Cisco - Support ticket #11062)
See: https://support.isc.org/Ticket/Display.html?id=11062 Hi ISC team, I have talked to Tomek on asking dhcp team to review my patch on the changes in ISC dhcp code base to support the work of relay source port draft. Obviously we have not got the IANA code point yet, so the option values used in the diff is just for temporary testing use. We would appreciate if you can review and comment on my patch, so in future days we can possibly ask for submitting this feature in ISC dhcp. A readme file is also enclosed. Many thanks. - Naiming Naiming Shen (naiming) <naiming@cisco.com> CC: Enke Chen <enkechen@cisco.com>
Hello Naiming: First, I apologize for the delay in getting our comments back to you regarding the patch. In order to preserve formatting I have attached our review as a text file. In general, the patch mechanics are fine, but we would rather see the the relay port specification done per interface rather than as global parameter. Details on this are included in the attachment. To set expectations, these changes will not be included in our upcoming maintenance release, 4.3.6, due out in May '17. Rather they would go into our feature release, 4.4.0, which is due out later in the year, date is TBD. Thank you for your efforts thus far. If you have any comments or questions please let us know. Sincerely, Thomas Markwalder ISC Software Engineering
Subject: 44535.txt
We would like to the patch split as follows: 1. V4 Server support 2. V4 Relay support 3. V6 Server support 4. V6 Relay 5. 4o6 Support 2. The BPF filter changes seem fine. They allows an interface to accept messages either from the standard port or the alternate port which matches the RFC draft. For interfaces that are both up and down, though it would mean that the upstream could only receive on the alternate port as the first port in the filter would be the standard downstream port. This is likely acceptable versus more complicated filter logic. 3. The patch implements a global command line parameter, "-rp", used by dhcrelay to specify an alternate port value. When this parameter is specified the interface discovery code has been modified to only register one upstream and one downstream interface. It is unclear if this was done for simplicity or based upon a perceived most likely use-case. There is a more flexible approach, that supports multiple interfaces, and has the additional benefit of being more seamless: Add an optional port value to the v4's "-i,-iu,-U" and v6's "-u" command arguments: -iu interface[/port] -u [address%]interface[/port] This makes the alternate port use specific to an upstream interface. If users want only a single upstream or downstream interfaces they explicitly configure it that way, if they want more than one they can still do that. The steps to implement this are outlined below: Rather than a single global relay_port variable, add a member for it to struct interface_info: struct interface_info { : unit16_t relay_port; } relay/dhcrealy.c:request_v4_interface() Modify to look for the port value and populate it in the structure, only allowed if the flag parameter includes INTERFACE_UPSTREAM. relay/dhcrealy.c:parse_upstream() Modify to look for the port value and populate it in the structure. discover.c::discover_interfaces() Would not require the changes made by the patch, it would revert to as is. Several places would need look at the structure port value, instead of the global value: common/discover.c::lpf_gen_filter_setup(): if ((udp.uh_dport != local_port) && ((interface->relay_port == 0) || (udp.uh_dport != interface->relay_port))) common/packet.c:assemble_udp_ip_header(): udp.uh_sport = (interface->relay_port ? interface->relay_port : local_port); common/packet.c:decode_udp_ip_header(): if ((udp.uh_dport != local_port) && ((interface->relay_port == 0) || (udp.uh_dport != interface->relay_port))) common/raw.c:if_register_send(): name.sin_port = (info->relay_port ? info->relay_port: local_port; common/socket.c:if_register_socket(): addr6->sin6_port = (info->relay_port ? info->relay_port: local_port; The rest of the changes the patch makes to this function are unnecessary. relay/dhcrelay.c:process_up6() Relocate the logic to add the D6O_RELAY_PORT to inside the upstream send loop. Here the logic would need to be a little smarter: /* Send it to all upstreams. */ int has_relay_option = 0; for (up = upstreams; up; up = up->next) { if (has_relay_option) { /* Previous upstream added it, this either shouldn't * have it or needs to replace it, so let's remove it */ delete_option(&dhcpv6_universe, opts, D6O_RELAY_PORT); has_relay_option = 0; } if (upstream->relay_port || relay_client_port) { if (!save_option_buffer(&dhcpv6_universe, opts, NULL, (unsigned char *) &relay_client_port, sizeof(u_int16_t), D6O_RELAY_PORT, 0)) { log_error("Can't save relay-port."); option_state_dereference(&opts, MDL); return; } has_relay_option = 1; } send_packet6(up->ifp, (unsigned char *) forw_data, (size_t) cursor, &up->link); } Note these changes may not have covered everything necessary, and of course have not been been compile so there may syntax errors. However they should suffice to guide the actual code work. 4. The 4o6 patch seems fine. It adds room in the IPC header to accommodate the alternate port the V6 server received the message from so the v4 server can echo it back. This allows the V6 server to send the response back on the alternate port.
CC: "Enke Chen (enkechen)" <enkechen@cisco.com>
Subject: Re: [ISC-Bugs #44535] Patch: DHCP relay port feature code for review (from Cisco - Support ticket #11062)
Date: Mon, 27 Feb 2017 21:59:05 +0000
To: "dhcp-suggest@isc.org" <dhcp-suggest@isc.org>
From: "Naiming Shen (naiming)" <naiming@cisco.com>
Hi Thomas, Thanks for the detailed review. and We’ll look over this and get back to you. thanks. - Naiming > On Feb 27, 2017, at 6:09 AM, Thomas Markwalder via RT <dhcp-suggest@isc.org> wrote: > > Hello Naiming: > > First, I apologize for the delay in getting our comments back to you regarding the patch. In order to preserve formatting I have attached our > review as a text file. > > In general, the patch mechanics are fine, but we would rather see the > the relay port specification done per interface rather than as global parameter. Details on this are included in the attachment. > > To set expectations, these changes will not be included in our upcoming maintenance release, 4.3.6, due out in May '17. Rather they would go into our feature release, 4.4.0, which is due out later in the year, date is TBD. > > Thank you for your efforts thus far. If you have any comments or questions please let us know. > > Sincerely, > > Thomas Markwalder > ISC Software Engineering > > > > We would like to the patch split as follows: > > 1. V4 Server support > 2. V4 Relay support > 3. V6 Server support > 4. V6 Relay > 5. 4o6 Support > > 2. The BPF filter changes seem fine. They allows an interface to accept > messages either from the standard port or the alternate port which matches > the RFC draft. For interfaces that are both up and down, though it would > mean that the upstream could only receive on the alternate port as the first > port in the filter would be the standard downstream port. This is likely > acceptable versus more complicated filter logic. > > 3. The patch implements a global command line parameter, "-rp", used by > dhcrelay to specify an alternate port value. When this parameter is specified > the interface discovery code has been modified to only register one upstream > and one downstream interface. > > It is unclear if this was done for simplicity or based upon a perceived most > likely use-case. There is a more flexible approach, that supports multiple > interfaces, and has the additional benefit of being more seamless: > > Add an optional port value to the v4's "-i,-iu,-U" and v6's "-u" command arguments: > > -iu interface[/port] > > -u [address%]interface[/port] > > This makes the alternate port use specific to an upstream interface. If users want only a single upstream or downstream interfaces they explicitly configure it that way, if they want more than one they can still do that. > > The steps to implement this are outlined below: > > Rather than a single global relay_port variable, add a member for it to struct interface_info: > > struct interface_info { > : > unit16_t relay_port; > } > > > relay/dhcrealy.c:request_v4_interface() > Modify to look for the port value and populate it in the structure, only > allowed if the flag parameter includes INTERFACE_UPSTREAM. > > relay/dhcrealy.c:parse_upstream() > Modify to look for the port value and populate it in the structure. > > discover.c::discover_interfaces() > Would not require the changes made by the patch, it would revert to as is. > > > Several places would need look at the structure port value, instead of the global value: > > common/discover.c::lpf_gen_filter_setup(): > > if ((udp.uh_dport != local_port) && > ((interface->relay_port == 0) || (udp.uh_dport != interface->relay_port))) > > > common/packet.c:assemble_udp_ip_header(): > > udp.uh_sport = (interface->relay_port ? interface->relay_port : local_port); > > common/packet.c:decode_udp_ip_header(): > > if ((udp.uh_dport != local_port) && > ((interface->relay_port == 0) || (udp.uh_dport != interface->relay_port))) > > common/raw.c:if_register_send(): > > name.sin_port = (info->relay_port ? info->relay_port: local_port; > > common/socket.c:if_register_socket(): > > addr6->sin6_port = (info->relay_port ? info->relay_port: local_port; > > The rest of the changes the patch makes to this function are unnecessary. > > relay/dhcrelay.c:process_up6() > Relocate the logic to add the D6O_RELAY_PORT to inside the upstream send > loop. Here the logic would need to be a little smarter: > > /* Send it to all upstreams. */ > int has_relay_option = 0; > for (up = upstreams; up; up = up->next) { > if (has_relay_option) { > /* Previous upstream added it, this either shouldn't > * have it or needs to replace it, so let's remove it */ > delete_option(&dhcpv6_universe, opts, D6O_RELAY_PORT); > has_relay_option = 0; > } > > if (upstream->relay_port || relay_client_port) { > if (!save_option_buffer(&dhcpv6_universe, opts, NULL, > (unsigned char *) &relay_client_port, sizeof(u_int16_t), > D6O_RELAY_PORT, 0)) { > log_error("Can't save relay-port."); > option_state_dereference(&opts, MDL); > return; > } > > has_relay_option = 1; > } > > send_packet6(up->ifp, (unsigned char *) forw_data, > (size_t) cursor, &up->link); > } > > Note these changes may not have covered everything necessary, and of course > have not been been compile so there may syntax errors. However they should > suffice to guide the actual code work. > > > 4. The 4o6 patch seems fine. It adds room in the IPC header to accommodate the > alternate port the V6 server received the message from so the v4 server can > echo it back. This allows the V6 server to send the response back on the > alternate port. >
Hello Naiming: I am following up on the review we provided for you back in February. We are looking at feature content for our next feature release of ISC DHCP, 4.4.0. Can you tell the status of your efforts there? Do you have follow up questions or feedback? Regards, Thomas Markwalder ISC Software Engineering On Mon Feb 27 21:59:12 2017, naiming@cisco.com wrote: > > Hi Thomas, > > Thanks for the detailed review. and We’ll look over this and get > back to you. thanks. > > - Naiming > > > On Feb 27, 2017, at 6:09 AM, Thomas Markwalder via RT <dhcp- > > suggest@isc.org> wrote: > > > > Hello Naiming: > > > > First, I apologize for the delay in getting our comments back to you > > regarding the patch. In order to preserve formatting I have attached > > our > > review as a text file. > > > > In general, the patch mechanics are fine, but we would rather see the > > the relay port specification done per interface rather than as global > > parameter. Details on this are included in the attachment. > > > > To set expectations, these changes will not be included in our > > upcoming maintenance release, 4.3.6, due out in May '17. Rather they > > would go into our feature release, 4.4.0, which is due out later in > > the year, date is TBD. > > > > Thank you for your efforts thus far. If you have any comments or > > questions please let us know. > > > > Sincerely, > > > > Thomas Markwalder > > ISC Software Engineering > > > > > > > > We would like to the patch split as follows: > > > > 1. V4 Server support > > 2. V4 Relay support > > 3. V6 Server support > > 4. V6 Relay > > 5. 4o6 Support > > > > 2. The BPF filter changes seem fine. They allows an interface to > > accept > > messages either from the standard port or the alternate port which > > matches > > the RFC draft. For interfaces that are both up and down, though it > > would > > mean that the upstream could only receive on the alternate port as > > the first > > port in the filter would be the standard downstream port. This is > > likely > > acceptable versus more complicated filter logic. > > > > 3. The patch implements a global command line parameter, "-rp", used > > by > > dhcrelay to specify an alternate port value. When this parameter is > > specified > > the interface discovery code has been modified to only register one > > upstream > > and one downstream interface. > > > > It is unclear if this was done for simplicity or based upon a > > perceived most > > likely use-case. There is a more flexible approach, that supports > > multiple > > interfaces, and has the additional benefit of being more seamless: > > > > Add an optional port value to the v4's "-i,-iu,-U" and v6's "-u" > > command arguments: > > > > -iu interface[/port] > > > > -u [address%]interface[/port] > > > > This makes the alternate port use specific to an upstream interface. > > If users want only a single upstream or downstream interfaces they > > explicitly configure it that way, if they want more than one they can > > still do that. > > > > The steps to implement this are outlined below: > > > > Rather than a single global relay_port variable, add a member for it > > to struct interface_info: > > > > struct interface_info { > > : > > unit16_t relay_port; > > } > > > > > > relay/dhcrealy.c:request_v4_interface() > > Modify to look for the port value and populate it in the > > structure, only > > allowed if the flag parameter includes INTERFACE_UPSTREAM. > > > > relay/dhcrealy.c:parse_upstream() > > Modify to look for the port value and populate it in the > > structure. > > > > discover.c::discover_interfaces() > > Would not require the changes made by the patch, it would revert > > to as is. > > > > > > Several places would need look at the structure port value, instead > > of the global value: > > > > common/discover.c::lpf_gen_filter_setup(): > > > > if ((udp.uh_dport != local_port) && > > ((interface->relay_port == 0) || (udp.uh_dport != interface- > > >relay_port))) > > > > > > common/packet.c:assemble_udp_ip_header(): > > > > udp.uh_sport = (interface->relay_port ? interface->relay_port : > > local_port); > > > > common/packet.c:decode_udp_ip_header(): > > > > if ((udp.uh_dport != local_port) && > > ((interface->relay_port == 0) || (udp.uh_dport != interface- > > >relay_port))) > > > > common/raw.c:if_register_send(): > > > > name.sin_port = (info->relay_port ? info->relay_port: local_port; > > > > common/socket.c:if_register_socket(): > > > > addr6->sin6_port = (info->relay_port ? info->relay_port: local_port; > > > > The rest of the changes the patch makes to this function are > > unnecessary. > > > > relay/dhcrelay.c:process_up6() > > Relocate the logic to add the D6O_RELAY_PORT to inside the > > upstream send > > loop. Here the logic would need to be a little smarter: > > > > /* Send it to all upstreams. */ > > int has_relay_option = 0; > > for (up = upstreams; up; up = up->next) { > > if (has_relay_option) { > > /* Previous upstream added it, this either shouldn't > > * have it or needs to replace it, so let's remove it */ > > delete_option(&dhcpv6_universe, opts, D6O_RELAY_PORT); > > has_relay_option = 0; > > } > > > > if (upstream->relay_port || relay_client_port) { > > if (!save_option_buffer(&dhcpv6_universe, opts, NULL, > > (unsigned char *) &relay_client_port, sizeof(u_int16_t), > > D6O_RELAY_PORT, 0)) { > > log_error("Can't save relay-port."); > > option_state_dereference(&opts, MDL); > > return; > > } > > > > has_relay_option = 1; > > } > > > > send_packet6(up->ifp, (unsigned char *) forw_data, > > (size_t) cursor, &up->link); > > } > > > > Note these changes may not have covered everything necessary, and of > > course > > have not been been compile so there may syntax errors. However they > > should > > suffice to guide the actual code work. > > > > > > 4. The 4o6 patch seems fine. It adds room in the IPC header to > > accommodate the > > alternate port the V6 server received the message from so the v4 > > server can > > echo it back. This allows the V6 server to send the response back on > > the > > alternate port. > > >
CC: "Enke Chen (enkechen)" <enkechen@cisco.com>
Subject: Re: [ISC-Bugs #44535] Patch: DHCP relay port feature code for review (from Cisco - Support ticket #11062)
Date: Tue, 2 May 2017 15:42:54 +0000
To: "dhcp-suggest@isc.org" <dhcp-suggest@isc.org>
From: "Naiming Shen (naiming)" <naiming@cisco.com>
Hi Thomas, I’ll modified the patch of the ‘relay port’ feature in these two weeks based on your comments. Sorry for the delay. The working group has passed the Last Call on this draft, and I was waiting to see if we could get IANA official assigned numbers. But I think I’ll modify the patch first. Best Regards, - Naiming > On May 2, 2017, at 7:31 AM, Thomas Markwalder via RT <dhcp-suggest@isc.org> wrote: > > Hello Naiming: > > I am following up on the review we provided for you back in February. We are looking at feature content for our next feature release of ISC DHCP, 4.4.0. > > Can you tell the status of your efforts there? Do you have follow up questions or feedback? > > Regards, > > Thomas Markwalder > ISC Software Engineering > > > > On Mon Feb 27 21:59:12 2017, naiming@cisco.com wrote: >> >> Hi Thomas, >> >> Thanks for the detailed review. and We’ll look over this and get >> back to you. thanks. >> >> - Naiming >> >>> On Feb 27, 2017, at 6:09 AM, Thomas Markwalder via RT <dhcp- >>> suggest@isc.org> wrote: >>> >>> Hello Naiming: >>> >>> First, I apologize for the delay in getting our comments back to you >>> regarding the patch. In order to preserve formatting I have attached >>> our >>> review as a text file. >>> >>> In general, the patch mechanics are fine, but we would rather see the >>> the relay port specification done per interface rather than as global >>> parameter. Details on this are included in the attachment. >>> >>> To set expectations, these changes will not be included in our >>> upcoming maintenance release, 4.3.6, due out in May '17. Rather they >>> would go into our feature release, 4.4.0, which is due out later in >>> the year, date is TBD. >>> >>> Thank you for your efforts thus far. If you have any comments or >>> questions please let us know. >>> >>> Sincerely, >>> >>> Thomas Markwalder >>> ISC Software Engineering >>> >>> >>> >>> We would like to the patch split as follows: >>> >>> 1. V4 Server support >>> 2. V4 Relay support >>> 3. V6 Server support >>> 4. V6 Relay >>> 5. 4o6 Support >>> >>> 2. The BPF filter changes seem fine. They allows an interface to >>> accept >>> messages either from the standard port or the alternate port which >>> matches >>> the RFC draft. For interfaces that are both up and down, though it >>> would >>> mean that the upstream could only receive on the alternate port as >>> the first >>> port in the filter would be the standard downstream port. This is >>> likely >>> acceptable versus more complicated filter logic. >>> >>> 3. The patch implements a global command line parameter, "-rp", used >>> by >>> dhcrelay to specify an alternate port value. When this parameter is >>> specified >>> the interface discovery code has been modified to only register one >>> upstream >>> and one downstream interface. >>> >>> It is unclear if this was done for simplicity or based upon a >>> perceived most >>> likely use-case. There is a more flexible approach, that supports >>> multiple >>> interfaces, and has the additional benefit of being more seamless: >>> >>> Add an optional port value to the v4's "-i,-iu,-U" and v6's "-u" >>> command arguments: >>> >>> -iu interface[/port] >>> >>> -u [address%]interface[/port] >>> >>> This makes the alternate port use specific to an upstream interface. >>> If users want only a single upstream or downstream interfaces they >>> explicitly configure it that way, if they want more than one they can >>> still do that. >>> >>> The steps to implement this are outlined below: >>> >>> Rather than a single global relay_port variable, add a member for it >>> to struct interface_info: >>> >>> struct interface_info { >>> : >>> unit16_t relay_port; >>> } >>> >>> >>> relay/dhcrealy.c:request_v4_interface() >>> Modify to look for the port value and populate it in the >>> structure, only >>> allowed if the flag parameter includes INTERFACE_UPSTREAM. >>> >>> relay/dhcrealy.c:parse_upstream() >>> Modify to look for the port value and populate it in the >>> structure. >>> >>> discover.c::discover_interfaces() >>> Would not require the changes made by the patch, it would revert >>> to as is. >>> >>> >>> Several places would need look at the structure port value, instead >>> of the global value: >>> >>> common/discover.c::lpf_gen_filter_setup(): >>> >>> if ((udp.uh_dport != local_port) && >>> ((interface->relay_port == 0) || (udp.uh_dport != interface- >>>> relay_port))) >>> >>> >>> common/packet.c:assemble_udp_ip_header(): >>> >>> udp.uh_sport = (interface->relay_port ? interface->relay_port : >>> local_port); >>> >>> common/packet.c:decode_udp_ip_header(): >>> >>> if ((udp.uh_dport != local_port) && >>> ((interface->relay_port == 0) || (udp.uh_dport != interface- >>>> relay_port))) >>> >>> common/raw.c:if_register_send(): >>> >>> name.sin_port = (info->relay_port ? info->relay_port: local_port; >>> >>> common/socket.c:if_register_socket(): >>> >>> addr6->sin6_port = (info->relay_port ? info->relay_port: local_port; >>> >>> The rest of the changes the patch makes to this function are >>> unnecessary. >>> >>> relay/dhcrelay.c:process_up6() >>> Relocate the logic to add the D6O_RELAY_PORT to inside the >>> upstream send >>> loop. Here the logic would need to be a little smarter: >>> >>> /* Send it to all upstreams. */ >>> int has_relay_option = 0; >>> for (up = upstreams; up; up = up->next) { >>> if (has_relay_option) { >>> /* Previous upstream added it, this either shouldn't >>> * have it or needs to replace it, so let's remove it */ >>> delete_option(&dhcpv6_universe, opts, D6O_RELAY_PORT); >>> has_relay_option = 0; >>> } >>> >>> if (upstream->relay_port || relay_client_port) { >>> if (!save_option_buffer(&dhcpv6_universe, opts, NULL, >>> (unsigned char *) &relay_client_port, sizeof(u_int16_t), >>> D6O_RELAY_PORT, 0)) { >>> log_error("Can't save relay-port."); >>> option_state_dereference(&opts, MDL); >>> return; >>> } >>> >>> has_relay_option = 1; >>> } >>> >>> send_packet6(up->ifp, (unsigned char *) forw_data, >>> (size_t) cursor, &up->link); >>> } >>> >>> Note these changes may not have covered everything necessary, and of >>> course >>> have not been been compile so there may syntax errors. However they >>> should >>> suffice to guide the actual code work. >>> >>> >>> 4. The 4o6 patch seems fine. It adds room in the IPC header to >>> accommodate the >>> alternate port the V6 server received the message from so the v4 >>> server can >>> echo it back. This allows the V6 server to send the response back on >>> the >>> alternate port. >>> >> > > >
Hi Naiming: Thank you for your prompt reply. I can understand you wanting to wait. Since we've passed the last call it should be safe enough to develop the patch and just use place-holder values until there are official values rom IANA. Hopefully, we'll have them well before we release time. In the meantime, if you run into any issues or questions just let me know. Cheers, Thomas If you have any questions or run into issues please let me know. On Tue May 02 15:43:00 2017, naiming@cisco.com wrote: > > Hi Thomas, > > I’ll modified the patch of the ‘relay port’ feature in these two weeks > based on your comments. Sorry for the delay. > The working group has passed the Last Call on this draft, and > I was waiting to see if we could get IANA official assigned numbers. > But I think I’ll modify the patch first. > > Best Regards, > - Naiming > > > On May 2, 2017, at 7:31 AM, Thomas Markwalder via RT <dhcp- > > suggest@isc.org> wrote: > > > > Hello Naiming: > > > > I am following up on the review we provided for you back in February. > > We are looking at feature content for our next feature release of ISC > > DHCP, 4.4.0. > > > > Can you tell the status of your efforts there? Do you have follow up > > questions or feedback? > > > > Regards, > > > > Thomas Markwalder > > ISC Software Engineering > > > > > > > > On Mon Feb 27 21:59:12 2017, naiming@cisco.com wrote: > >> > >> Hi Thomas, > >> > >> Thanks for the detailed review. and We’ll look over this and get > >> back to you. thanks. > >> > >> - Naiming > >> > >>> On Feb 27, 2017, at 6:09 AM, Thomas Markwalder via RT <dhcp- > >>> suggest@isc.org> wrote: > >>> > >>> Hello Naiming: > >>> > >>> First, I apologize for the delay in getting our comments back to > >>> you > >>> regarding the patch. In order to preserve formatting I have > >>> attached > >>> our > >>> review as a text file. > >>> > >>> In general, the patch mechanics are fine, but we would rather see > >>> the > >>> the relay port specification done per interface rather than as > >>> global > >>> parameter. Details on this are included in the attachment. > >>> > >>> To set expectations, these changes will not be included in our > >>> upcoming maintenance release, 4.3.6, due out in May '17. Rather > >>> they > >>> would go into our feature release, 4.4.0, which is due out later in > >>> the year, date is TBD. > >>> > >>> Thank you for your efforts thus far. If you have any comments or > >>> questions please let us know. > >>> > >>> Sincerely, > >>> > >>> Thomas Markwalder > >>> ISC Software Engineering > >>> > >>> > >>> > >>> We would like to the patch split as follows: > >>> > >>> 1. V4 Server support > >>> 2. V4 Relay support > >>> 3. V6 Server support > >>> 4. V6 Relay > >>> 5. 4o6 Support > >>> > >>> 2. The BPF filter changes seem fine. They allows an interface to > >>> accept > >>> messages either from the standard port or the alternate port which > >>> matches > >>> the RFC draft. For interfaces that are both up and down, though it > >>> would > >>> mean that the upstream could only receive on the alternate port as > >>> the first > >>> port in the filter would be the standard downstream port. This is > >>> likely > >>> acceptable versus more complicated filter logic. > >>> > >>> 3. The patch implements a global command line parameter, "-rp", > >>> used > >>> by > >>> dhcrelay to specify an alternate port value. When this parameter is > >>> specified > >>> the interface discovery code has been modified to only register one > >>> upstream > >>> and one downstream interface. > >>> > >>> It is unclear if this was done for simplicity or based upon a > >>> perceived most > >>> likely use-case. There is a more flexible approach, that supports > >>> multiple > >>> interfaces, and has the additional benefit of being more seamless: > >>> > >>> Add an optional port value to the v4's "-i,-iu,-U" and v6's "-u" > >>> command arguments: > >>> > >>> -iu interface[/port] > >>> > >>> -u [address%]interface[/port] > >>> > >>> This makes the alternate port use specific to an upstream > >>> interface. > >>> If users want only a single upstream or downstream interfaces they > >>> explicitly configure it that way, if they want more than one they > >>> can > >>> still do that. > >>> > >>> The steps to implement this are outlined below: > >>> > >>> Rather than a single global relay_port variable, add a member for > >>> it > >>> to struct interface_info: > >>> > >>> struct interface_info { > >>> : > >>> unit16_t relay_port; > >>> } > >>> > >>> > >>> relay/dhcrealy.c:request_v4_interface() > >>> Modify to look for the port value and populate it in the > >>> structure, only > >>> allowed if the flag parameter includes INTERFACE_UPSTREAM. > >>> > >>> relay/dhcrealy.c:parse_upstream() > >>> Modify to look for the port value and populate it in the > >>> structure. > >>> > >>> discover.c::discover_interfaces() > >>> Would not require the changes made by the patch, it would revert > >>> to as is. > >>> > >>> > >>> Several places would need look at the structure port value, instead > >>> of the global value: > >>> > >>> common/discover.c::lpf_gen_filter_setup(): > >>> > >>> if ((udp.uh_dport != local_port) && > >>> ((interface->relay_port == 0) || (udp.uh_dport != interface- > >>>> relay_port))) > >>> > >>> > >>> common/packet.c:assemble_udp_ip_header(): > >>> > >>> udp.uh_sport = (interface->relay_port ? interface->relay_port : > >>> local_port); > >>> > >>> common/packet.c:decode_udp_ip_header(): > >>> > >>> if ((udp.uh_dport != local_port) && > >>> ((interface->relay_port == 0) || (udp.uh_dport != interface- > >>>> relay_port))) > >>> > >>> common/raw.c:if_register_send(): > >>> > >>> name.sin_port = (info->relay_port ? info->relay_port: local_port; > >>> > >>> common/socket.c:if_register_socket(): > >>> > >>> addr6->sin6_port = (info->relay_port ? info->relay_port: > >>> local_port; > >>> > >>> The rest of the changes the patch makes to this function are > >>> unnecessary. > >>> > >>> relay/dhcrelay.c:process_up6() > >>> Relocate the logic to add the D6O_RELAY_PORT to inside the > >>> upstream send > >>> loop. Here the logic would need to be a little smarter: > >>> > >>> /* Send it to all upstreams. */ > >>> int has_relay_option = 0; > >>> for (up = upstreams; up; up = up->next) { > >>> if (has_relay_option) { > >>> /* Previous upstream added it, this either shouldn't > >>> * have it or needs to replace it, so let's remove it */ > >>> delete_option(&dhcpv6_universe, opts, D6O_RELAY_PORT); > >>> has_relay_option = 0; > >>> } > >>> > >>> if (upstream->relay_port || relay_client_port) { > >>> if (!save_option_buffer(&dhcpv6_universe, opts, NULL, > >>> (unsigned char *) &relay_client_port, sizeof(u_int16_t), > >>> D6O_RELAY_PORT, 0)) { > >>> log_error("Can't save relay-port."); > >>> option_state_dereference(&opts, MDL); > >>> return; > >>> } > >>> > >>> has_relay_option = 1; > >>> } > >>> > >>> send_packet6(up->ifp, (unsigned char *) forw_data, > >>> (size_t) cursor, &up->link); > >>> } > >>> > >>> Note these changes may not have covered everything necessary, and > >>> of > >>> course > >>> have not been been compile so there may syntax errors. However they > >>> should > >>> suffice to guide the actual code work. > >>> > >>> > >>> 4. The 4o6 patch seems fine. It adds room in the IPC header to > >>> accommodate the > >>> alternate port the V6 server received the message from so the v4 > >>> server can > >>> echo it back. This allows the V6 server to send the response back > >>> on > >>> the > >>> alternate port. > >>> > >> > > > > > > >
CC: "Enke Chen (enkechen)" <enkechen@cisco.com>
Subject: Re: [ISC-Bugs #44535] Patch: DHCP relay port feature code for review (from Cisco - Support ticket #11062)
Date: Tue, 2 May 2017 16:16:33 +0000
To: "dhcp-suggest@isc.org" <dhcp-suggest@isc.org>
From: "Naiming Shen (naiming)" <naiming@cisco.com>
Hi Thomas, Thanks and I agree. What is the approacimate time of 4.4.0 of DHCP? Best Regards, - Naiming > On May 2, 2017, at 8:52 AM, Thomas Markwalder via RT <dhcp-suggest@isc.org> wrote: > > Hi Naiming: > > Thank you for your prompt reply. I can understand you wanting to wait. Since we've passed the last call it should be safe enough to develop the patch and just use place-holder values until there are official values rom IANA. Hopefully, we'll have them well before we release time. > > In the meantime, if you run into any issues or questions just let me know. > > Cheers, > > Thomas > > If you have any questions or run into issues please let me know. > On Tue May 02 15:43:00 2017, naiming@cisco.com wrote: >> >> Hi Thomas, >> >> I’ll modified the patch of the ‘relay port’ feature in these two weeks >> based on your comments. Sorry for the delay. >> The working group has passed the Last Call on this draft, and >> I was waiting to see if we could get IANA official assigned numbers. >> But I think I’ll modify the patch first. >> >> Best Regards, >> - Naiming >> >>> On May 2, 2017, at 7:31 AM, Thomas Markwalder via RT <dhcp- >>> suggest@isc.org> wrote: >>> >>> Hello Naiming: >>> >>> I am following up on the review we provided for you back in February. >>> We are looking at feature content for our next feature release of ISC >>> DHCP, 4.4.0. >>> >>> Can you tell the status of your efforts there? Do you have follow up >>> questions or feedback? >>> >>> Regards, >>> >>> Thomas Markwalder >>> ISC Software Engineering >>> >>> >>> >>> On Mon Feb 27 21:59:12 2017, naiming@cisco.com wrote: >>>> >>>> Hi Thomas, >>>> >>>> Thanks for the detailed review. and We’ll look over this and get >>>> back to you. thanks. >>>> >>>> - Naiming >>>> >>>>> On Feb 27, 2017, at 6:09 AM, Thomas Markwalder via RT <dhcp- >>>>> suggest@isc.org> wrote: >>>>> >>>>> Hello Naiming: >>>>> >>>>> First, I apologize for the delay in getting our comments back to >>>>> you >>>>> regarding the patch. In order to preserve formatting I have >>>>> attached >>>>> our >>>>> review as a text file. >>>>> >>>>> In general, the patch mechanics are fine, but we would rather see >>>>> the >>>>> the relay port specification done per interface rather than as >>>>> global >>>>> parameter. Details on this are included in the attachment. >>>>> >>>>> To set expectations, these changes will not be included in our >>>>> upcoming maintenance release, 4.3.6, due out in May '17. Rather >>>>> they >>>>> would go into our feature release, 4.4.0, which is due out later in >>>>> the year, date is TBD. >>>>> >>>>> Thank you for your efforts thus far. If you have any comments or >>>>> questions please let us know. >>>>> >>>>> Sincerely, >>>>> >>>>> Thomas Markwalder >>>>> ISC Software Engineering >>>>> >>>>> >>>>> >>>>> We would like to the patch split as follows: >>>>> >>>>> 1. V4 Server support >>>>> 2. V4 Relay support >>>>> 3. V6 Server support >>>>> 4. V6 Relay >>>>> 5. 4o6 Support >>>>> >>>>> 2. The BPF filter changes seem fine. They allows an interface to >>>>> accept >>>>> messages either from the standard port or the alternate port which >>>>> matches >>>>> the RFC draft. For interfaces that are both up and down, though it >>>>> would >>>>> mean that the upstream could only receive on the alternate port as >>>>> the first >>>>> port in the filter would be the standard downstream port. This is >>>>> likely >>>>> acceptable versus more complicated filter logic. >>>>> >>>>> 3. The patch implements a global command line parameter, "-rp", >>>>> used >>>>> by >>>>> dhcrelay to specify an alternate port value. When this parameter is >>>>> specified >>>>> the interface discovery code has been modified to only register one >>>>> upstream >>>>> and one downstream interface. >>>>> >>>>> It is unclear if this was done for simplicity or based upon a >>>>> perceived most >>>>> likely use-case. There is a more flexible approach, that supports >>>>> multiple >>>>> interfaces, and has the additional benefit of being more seamless: >>>>> >>>>> Add an optional port value to the v4's "-i,-iu,-U" and v6's "-u" >>>>> command arguments: >>>>> >>>>> -iu interface[/port] >>>>> >>>>> -u [address%]interface[/port] >>>>> >>>>> This makes the alternate port use specific to an upstream >>>>> interface. >>>>> If users want only a single upstream or downstream interfaces they >>>>> explicitly configure it that way, if they want more than one they >>>>> can >>>>> still do that. >>>>> >>>>> The steps to implement this are outlined below: >>>>> >>>>> Rather than a single global relay_port variable, add a member for >>>>> it >>>>> to struct interface_info: >>>>> >>>>> struct interface_info { >>>>> : >>>>> unit16_t relay_port; >>>>> } >>>>> >>>>> >>>>> relay/dhcrealy.c:request_v4_interface() >>>>> Modify to look for the port value and populate it in the >>>>> structure, only >>>>> allowed if the flag parameter includes INTERFACE_UPSTREAM. >>>>> >>>>> relay/dhcrealy.c:parse_upstream() >>>>> Modify to look for the port value and populate it in the >>>>> structure. >>>>> >>>>> discover.c::discover_interfaces() >>>>> Would not require the changes made by the patch, it would revert >>>>> to as is. >>>>> >>>>> >>>>> Several places would need look at the structure port value, instead >>>>> of the global value: >>>>> >>>>> common/discover.c::lpf_gen_filter_setup(): >>>>> >>>>> if ((udp.uh_dport != local_port) && >>>>> ((interface->relay_port == 0) || (udp.uh_dport != interface- >>>>>> relay_port))) >>>>> >>>>> >>>>> common/packet.c:assemble_udp_ip_header(): >>>>> >>>>> udp.uh_sport = (interface->relay_port ? interface->relay_port : >>>>> local_port); >>>>> >>>>> common/packet.c:decode_udp_ip_header(): >>>>> >>>>> if ((udp.uh_dport != local_port) && >>>>> ((interface->relay_port == 0) || (udp.uh_dport != interface- >>>>>> relay_port))) >>>>> >>>>> common/raw.c:if_register_send(): >>>>> >>>>> name.sin_port = (info->relay_port ? info->relay_port: local_port; >>>>> >>>>> common/socket.c:if_register_socket(): >>>>> >>>>> addr6->sin6_port = (info->relay_port ? info->relay_port: >>>>> local_port; >>>>> >>>>> The rest of the changes the patch makes to this function are >>>>> unnecessary. >>>>> >>>>> relay/dhcrelay.c:process_up6() >>>>> Relocate the logic to add the D6O_RELAY_PORT to inside the >>>>> upstream send >>>>> loop. Here the logic would need to be a little smarter: >>>>> >>>>> /* Send it to all upstreams. */ >>>>> int has_relay_option = 0; >>>>> for (up = upstreams; up; up = up->next) { >>>>> if (has_relay_option) { >>>>> /* Previous upstream added it, this either shouldn't >>>>> * have it or needs to replace it, so let's remove it */ >>>>> delete_option(&dhcpv6_universe, opts, D6O_RELAY_PORT); >>>>> has_relay_option = 0; >>>>> } >>>>> >>>>> if (upstream->relay_port || relay_client_port) { >>>>> if (!save_option_buffer(&dhcpv6_universe, opts, NULL, >>>>> (unsigned char *) &relay_client_port, sizeof(u_int16_t), >>>>> D6O_RELAY_PORT, 0)) { >>>>> log_error("Can't save relay-port."); >>>>> option_state_dereference(&opts, MDL); >>>>> return; >>>>> } >>>>> >>>>> has_relay_option = 1; >>>>> } >>>>> >>>>> send_packet6(up->ifp, (unsigned char *) forw_data, >>>>> (size_t) cursor, &up->link); >>>>> } >>>>> >>>>> Note these changes may not have covered everything necessary, and >>>>> of >>>>> course >>>>> have not been been compile so there may syntax errors. However they >>>>> should >>>>> suffice to guide the actual code work. >>>>> >>>>> >>>>> 4. The 4o6 patch seems fine. It adds room in the IPC header to >>>>> accommodate the >>>>> alternate port the V6 server received the message from so the v4 >>>>> server can >>>>> echo it back. This allows the V6 server to send the response back >>>>> on >>>>> the >>>>> alternate port. >>>>> >>>> >>> >>> >>> >> > > >
Subject: Re: [ISC-Bugs #44535] Patch: DHCP relay port feature code for review (from Cisco - Support ticket #11062)
Date: Tue, 2 May 2017 13:10:00 -0400
To: dhcp-suggest@isc.org
From: "Thomas Markwalder" <tmark@isc.org>
On 5/2/17 12:16 PM, Naiming Shen (naiming) via RT wrote: > Hi Thomas, > > Thanks and I agree. What is the approacimate time of 4.4.0 of DHCP? > > Best Regards, > - Naiming > >> On May 2, 2017, at 8:52 AM, Thomas Markwalder via RT <dhcp-suggest@isc.org> wrote: >> >> Hi Naiming: >> >> Thank you for your prompt reply. I can understand you wanting to wait. Since we've passed the last call it should be safe enough to develop the patch and just use place-holder values until there are official values rom IANA. Hopefully, we'll have them well before we release time. >> >> In the meantime, if you run into any issues or questions just let me know. >> >> Cheers, >> >> Thomas >> >> If you have any questions or run into issues please let me know. >> On Tue May 02 15:43:00 2017, naiming@cisco.com wrote: >>> Hi Thomas, >>> >>> I’ll modified the patch of the ‘relay port’ feature in these two weeks >>> based on your comments. Sorry for the delay. >>> The working group has passed the Last Call on this draft, and >>> I was waiting to see if we could get IANA official assigned numbers. >>> But I think I’ll modify the patch first. >>> >>> Best Regards, >>> - Naiming >>> >>>> On May 2, 2017, at 7:31 AM, Thomas Markwalder via RT <dhcp- >>>> suggest@isc.org> wrote: >>>> >>>> Hello Naiming: >>>> >>>> I am following up on the review we provided for you back in February. >>>> We are looking at feature content for our next feature release of ISC >>>> DHCP, 4.4.0. >>>> >>>> Can you tell the status of your efforts there? Do you have follow up >>>> questions or feedback? >>>> >>>> Regards, >>>> >>>> Thomas Markwalder >>>> ISC Software Engineering >>>> >>>> >>>> >>>> On Mon Feb 27 21:59:12 2017, naiming@cisco.com wrote: >>>>> Hi Thomas, >>>>> >>>>> Thanks for the detailed review. and We’ll look over this and get >>>>> back to you. thanks. >>>>> >>>>> - Naiming >>>>> >>>>>> On Feb 27, 2017, at 6:09 AM, Thomas Markwalder via RT <dhcp- >>>>>> suggest@isc.org> wrote: >>>>>> >>>>>> Hello Naiming: >>>>>> >>>>>> First, I apologize for the delay in getting our comments back to >>>>>> you >>>>>> regarding the patch. In order to preserve formatting I have >>>>>> attached >>>>>> our >>>>>> review as a text file. >>>>>> >>>>>> In general, the patch mechanics are fine, but we would rather see >>>>>> the >>>>>> the relay port specification done per interface rather than as >>>>>> global >>>>>> parameter. Details on this are included in the attachment. >>>>>> >>>>>> To set expectations, these changes will not be included in our >>>>>> upcoming maintenance release, 4.3.6, due out in May '17. Rather >>>>>> they >>>>>> would go into our feature release, 4.4.0, which is due out later in >>>>>> the year, date is TBD. >>>>>> >>>>>> Thank you for your efforts thus far. If you have any comments or >>>>>> questions please let us know. >>>>>> >>>>>> Sincerely, >>>>>> >>>>>> Thomas Markwalder >>>>>> ISC Software Engineering >>>>>> >>>>>> >>>>>> >>>>>> We would like to the patch split as follows: >>>>>> >>>>>> 1. V4 Server support >>>>>> 2. V4 Relay support >>>>>> 3. V6 Server support >>>>>> 4. V6 Relay >>>>>> 5. 4o6 Support >>>>>> >>>>>> 2. The BPF filter changes seem fine. They allows an interface to >>>>>> accept >>>>>> messages either from the standard port or the alternate port which >>>>>> matches >>>>>> the RFC draft. For interfaces that are both up and down, though it >>>>>> would >>>>>> mean that the upstream could only receive on the alternate port as >>>>>> the first >>>>>> port in the filter would be the standard downstream port. This is >>>>>> likely >>>>>> acceptable versus more complicated filter logic. >>>>>> >>>>>> 3. The patch implements a global command line parameter, "-rp", >>>>>> used >>>>>> by >>>>>> dhcrelay to specify an alternate port value. When this parameter is >>>>>> specified >>>>>> the interface discovery code has been modified to only register one >>>>>> upstream >>>>>> and one downstream interface. >>>>>> >>>>>> It is unclear if this was done for simplicity or based upon a >>>>>> perceived most >>>>>> likely use-case. There is a more flexible approach, that supports >>>>>> multiple >>>>>> interfaces, and has the additional benefit of being more seamless: >>>>>> >>>>>> Add an optional port value to the v4's "-i,-iu,-U" and v6's "-u" >>>>>> command arguments: >>>>>> >>>>>> -iu interface[/port] >>>>>> >>>>>> -u [address%]interface[/port] >>>>>> >>>>>> This makes the alternate port use specific to an upstream >>>>>> interface. >>>>>> If users want only a single upstream or downstream interfaces they >>>>>> explicitly configure it that way, if they want more than one they >>>>>> can >>>>>> still do that. >>>>>> >>>>>> The steps to implement this are outlined below: >>>>>> >>>>>> Rather than a single global relay_port variable, add a member for >>>>>> it >>>>>> to struct interface_info: >>>>>> >>>>>> struct interface_info { >>>>>> : >>>>>> unit16_t relay_port; >>>>>> } >>>>>> >>>>>> >>>>>> relay/dhcrealy.c:request_v4_interface() >>>>>> Modify to look for the port value and populate it in the >>>>>> structure, only >>>>>> allowed if the flag parameter includes INTERFACE_UPSTREAM. >>>>>> >>>>>> relay/dhcrealy.c:parse_upstream() >>>>>> Modify to look for the port value and populate it in the >>>>>> structure. >>>>>> >>>>>> discover.c::discover_interfaces() >>>>>> Would not require the changes made by the patch, it would revert >>>>>> to as is. >>>>>> >>>>>> >>>>>> Several places would need look at the structure port value, instead >>>>>> of the global value: >>>>>> >>>>>> common/discover.c::lpf_gen_filter_setup(): >>>>>> >>>>>> if ((udp.uh_dport != local_port) && >>>>>> ((interface->relay_port == 0) || (udp.uh_dport != interface- >>>>>>> relay_port))) >>>>>> >>>>>> common/packet.c:assemble_udp_ip_header(): >>>>>> >>>>>> udp.uh_sport = (interface->relay_port ? interface->relay_port : >>>>>> local_port); >>>>>> >>>>>> common/packet.c:decode_udp_ip_header(): >>>>>> >>>>>> if ((udp.uh_dport != local_port) && >>>>>> ((interface->relay_port == 0) || (udp.uh_dport != interface- >>>>>>> relay_port))) >>>>>> common/raw.c:if_register_send(): >>>>>> >>>>>> name.sin_port = (info->relay_port ? info->relay_port: local_port; >>>>>> >>>>>> common/socket.c:if_register_socket(): >>>>>> >>>>>> addr6->sin6_port = (info->relay_port ? info->relay_port: >>>>>> local_port; >>>>>> >>>>>> The rest of the changes the patch makes to this function are >>>>>> unnecessary. >>>>>> >>>>>> relay/dhcrelay.c:process_up6() >>>>>> Relocate the logic to add the D6O_RELAY_PORT to inside the >>>>>> upstream send >>>>>> loop. Here the logic would need to be a little smarter: >>>>>> >>>>>> /* Send it to all upstreams. */ >>>>>> int has_relay_option = 0; >>>>>> for (up = upstreams; up; up = up->next) { >>>>>> if (has_relay_option) { >>>>>> /* Previous upstream added it, this either shouldn't >>>>>> * have it or needs to replace it, so let's remove it */ >>>>>> delete_option(&dhcpv6_universe, opts, D6O_RELAY_PORT); >>>>>> has_relay_option = 0; >>>>>> } >>>>>> >>>>>> if (upstream->relay_port || relay_client_port) { >>>>>> if (!save_option_buffer(&dhcpv6_universe, opts, NULL, >>>>>> (unsigned char *) &relay_client_port, sizeof(u_int16_t), >>>>>> D6O_RELAY_PORT, 0)) { >>>>>> log_error("Can't save relay-port."); >>>>>> option_state_dereference(&opts, MDL); >>>>>> return; >>>>>> } >>>>>> >>>>>> has_relay_option = 1; >>>>>> } >>>>>> >>>>>> send_packet6(up->ifp, (unsigned char *) forw_data, >>>>>> (size_t) cursor, &up->link); >>>>>> } >>>>>> >>>>>> Note these changes may not have covered everything necessary, and >>>>>> of >>>>>> course >>>>>> have not been been compile so there may syntax errors. However they >>>>>> should >>>>>> suffice to guide the actual code work. >>>>>> >>>>>> >>>>>> 4. The 4o6 patch seems fine. It adds room in the IPC header to >>>>>> accommodate the >>>>>> alternate port the V6 server received the message from so the v4 >>>>>> server can >>>>>> echo it back. This allows the V6 server to send the response back >>>>>> on >>>>>> the >>>>>> alternate port. >>>>>> >>>> >>>> >> >> > > That's yet to be decided. Possibly Q4/17. Thomas
CC: "Enke Chen (enkechen)" <enkechen@cisco.com>
Subject: Re: [ISC-Bugs #44535] Patch: DHCP relay port feature code for review (from Cisco - Support ticket #11062)
Date: Wed, 3 May 2017 23:43:57 +0000
To: "dhcp-suggest@isc.org" <dhcp-suggest@isc.org>
From: "Naiming Shen (naiming)" <naiming@cisco.com>
Hi Thomas, One thing I noticed when starting to make changes is that, the per-interface defintion of relay-port may have some issues. The current patch with this ‘-rp’ knob is modeling after the existing ‘-p’ usage, which means if we are changing the DHCP relay port number, it makes sense to change it for the global context. Since a relay agent device may have many interfaces. The DHCP server may be multiple hops away. From a relay-agent admin point of view (s)he does not exactly know which interface(s) it should use. Even (s)he knows for now, the routing may change later, and the device may also have too many interfaces to define each of them explicitly. The use case we explicitly target for this relay-port feature is because multiple relay instances sharing the same physical device with the same source IP address, so it can not use the same UDP relay port among different relay-agent processes. For this feature I doubt there is a need for one relay-agent trying to use different UDP ports for different interfaces. Best Regards, - Naiming > On Feb 27, 2017, at 6:09 AM, Thomas Markwalder via RT <dhcp-suggest@isc.org> wrote: > > Hello Naiming: > > First, I apologize for the delay in getting our comments back to you regarding the patch. In order to preserve formatting I have attached our > review as a text file. > > In general, the patch mechanics are fine, but we would rather see the > the relay port specification done per interface rather than as global parameter. Details on this are included in the attachment. > > To set expectations, these changes will not be included in our upcoming maintenance release, 4.3.6, due out in May '17. Rather they would go into our feature release, 4.4.0, which is due out later in the year, date is TBD. > > Thank you for your efforts thus far. If you have any comments or questions please let us know. > > Sincerely, > > Thomas Markwalder > ISC Software Engineering > > > > We would like to the patch split as follows: > > 1. V4 Server support > 2. V4 Relay support > 3. V6 Server support > 4. V6 Relay > 5. 4o6 Support > > 2. The BPF filter changes seem fine. They allows an interface to accept > messages either from the standard port or the alternate port which matches > the RFC draft. For interfaces that are both up and down, though it would > mean that the upstream could only receive on the alternate port as the first > port in the filter would be the standard downstream port. This is likely > acceptable versus more complicated filter logic. > > 3. The patch implements a global command line parameter, "-rp", used by > dhcrelay to specify an alternate port value. When this parameter is specified > the interface discovery code has been modified to only register one upstream > and one downstream interface. > > It is unclear if this was done for simplicity or based upon a perceived most > likely use-case. There is a more flexible approach, that supports multiple > interfaces, and has the additional benefit of being more seamless: > > Add an optional port value to the v4's "-i,-iu,-U" and v6's "-u" command arguments: > > -iu interface[/port] > > -u [address%]interface[/port] > > This makes the alternate port use specific to an upstream interface. If users want only a single upstream or downstream interfaces they explicitly configure it that way, if they want more than one they can still do that. > > The steps to implement this are outlined below: > > Rather than a single global relay_port variable, add a member for it to struct interface_info: > > struct interface_info { > : > unit16_t relay_port; > } > > > relay/dhcrealy.c:request_v4_interface() > Modify to look for the port value and populate it in the structure, only > allowed if the flag parameter includes INTERFACE_UPSTREAM. > > relay/dhcrealy.c:parse_upstream() > Modify to look for the port value and populate it in the structure. > > discover.c::discover_interfaces() > Would not require the changes made by the patch, it would revert to as is. > > > Several places would need look at the structure port value, instead of the global value: > > common/discover.c::lpf_gen_filter_setup(): > > if ((udp.uh_dport != local_port) && > ((interface->relay_port == 0) || (udp.uh_dport != interface->relay_port))) > > > common/packet.c:assemble_udp_ip_header(): > > udp.uh_sport = (interface->relay_port ? interface->relay_port : local_port); > > common/packet.c:decode_udp_ip_header(): > > if ((udp.uh_dport != local_port) && > ((interface->relay_port == 0) || (udp.uh_dport != interface->relay_port))) > > common/raw.c:if_register_send(): > > name.sin_port = (info->relay_port ? info->relay_port: local_port; > > common/socket.c:if_register_socket(): > > addr6->sin6_port = (info->relay_port ? info->relay_port: local_port; > > The rest of the changes the patch makes to this function are unnecessary. > > relay/dhcrelay.c:process_up6() > Relocate the logic to add the D6O_RELAY_PORT to inside the upstream send > loop. Here the logic would need to be a little smarter: > > /* Send it to all upstreams. */ > int has_relay_option = 0; > for (up = upstreams; up; up = up->next) { > if (has_relay_option) { > /* Previous upstream added it, this either shouldn't > * have it or needs to replace it, so let's remove it */ > delete_option(&dhcpv6_universe, opts, D6O_RELAY_PORT); > has_relay_option = 0; > } > > if (upstream->relay_port || relay_client_port) { > if (!save_option_buffer(&dhcpv6_universe, opts, NULL, > (unsigned char *) &relay_client_port, sizeof(u_int16_t), > D6O_RELAY_PORT, 0)) { > log_error("Can't save relay-port."); > option_state_dereference(&opts, MDL); > return; > } > > has_relay_option = 1; > } > > send_packet6(up->ifp, (unsigned char *) forw_data, > (size_t) cursor, &up->link); > } > > Note these changes may not have covered everything necessary, and of course > have not been been compile so there may syntax errors. However they should > suffice to guide the actual code work. > > > 4. The 4o6 patch seems fine. It adds room in the IPC header to accommodate the > alternate port the V6 server received the message from so the v4 server can > echo it back. This allows the V6 server to send the response back on the > alternate port. >
CC: "Enke Chen (enkechen)" <enkechen@cisco.com>
Subject: Re: [ISC-Bugs #44535] Patch: DHCP relay port feature code for review (from Cisco - Support ticket #11062)
Date: Mon, 8 May 2017 05:45:27 +0000
To: "dhcp-suggest@isc.org" <dhcp-suggest@isc.org>
From: "Naiming Shen (naiming)" <naiming@cisco.com>

Message body is not shown because it is too large.

CC: "Enke Chen (enkechen)" <enkechen@cisco.com>
Subject: Re: [ISC-Bugs #44535] Patch: DHCP relay port feature code for review (from Cisco - Support ticket #11062)
Date: Fri, 12 May 2017 20:53:37 +0000
To: "dhcp-suggest@isc.org" <dhcp-suggest@isc.org>
From: "Naiming Shen (naiming)" <naiming@cisco.com>

Hi, Thomas,

Enclosed are 5 patches for relayport feature, and a related notes.
Please review.

Best Regards,
- Naiming


Message body is not shown because sender requested not to inline it.

Message body is not shown because sender requested not to inline it.

Message body is not shown because sender requested not to inline it.

Message body is not shown because sender requested not to inline it.

Message body is not shown because sender requested not to inline it.

Message body is not shown because sender requested not to inline it.

Message body is not shown because sender requested not to inline it.

Message body is not shown because sender requested not to inline it.

Message body is not shown because sender requested not to inline it.

Message body is not shown because sender requested not to inline it.

Message body is not shown because sender requested not to inline it.

Message body is not shown because sender requested not to inline it.

Hello Naiming: After re-reviewing your proposed changes in light of the intended use cases and your other comments, I tend to agree with your assessment that a single global alternate port value seems to make more sense. Thank you for creating the individual patches as requested. Given the draft's current status we may wrap the changes in a conditional compilation flag. This would allow it be included in the release, even if the draft has not been accepted. Testing the changes will not be trivial given the number of permutations. We'll need to make sure we covering not just new behavior but existing behavior for regressions. Toward that end, any additional testing that you might do and document would be helpful. We'll keep you posted as things progress. As we are focusing on our upcoming maintenance releases, 4.3.6 and 4.1-ESV-R15, due July 31st I would not expect too much to happen with this issue until after that. Should you have any follow up questions or concerns, please do not hesitate to contact us. Regards, Thomas Markwalder ISC Software Engineering
CC: "Enke Chen (enkechen)" <enkechen@cisco.com>
Subject: Re: [ISC-Bugs #44535] Patch: DHCP relay port feature code for review (from Cisco - Support ticket #11062)
Date: Fri, 26 May 2017 03:25:14 +0000
To: "dhcp-suggest@isc.org" <dhcp-suggest@isc.org>
From: "Naiming Shen (naiming)" <naiming@cisco.com>
Hi Thomas, Thanks for the email and the status. I enclosed a file which has my testing of this feature with IPv4 and IPv6. In IPv6 I have two relay agents both use non-DHCP UDP ports. The file has the topology, the command line parameters, and the client and server configuration files. Just for your reference. Best Regards, - Naiming Shen

Message body is not shown because sender requested not to inline it.

Message body is not shown because sender requested not to inline it.

Code done. I have some questions/comments (beginning by what you want for the RELNOTES) and some tests to do before pushing this on the review queue.
Comments about the I-D (10.txt): - RAI sub-options have no real official names, IMHO in SUBOPT_RELAY_PORT the SUBOPT_ is not necessary but it does not matter. BTW the code uses also things around relay-port. - I have more a concern about OPTION_RELAY_RELAY_PORT which should be OPTION_RELAY_SOURCE_PORT. IMHO it is a typo. - in 5.2 in the server behavior I don't understand what "check" means in "the IPv6 server MUST check and use the UDP source port from the UDP packet..."? To conclude about the I-D I use as temporary values 19 (next free value) and 135 (vs 90 which is already assigned).
By patch comments (in the order I integrated them): server-v4: * uint16_t -> u_int16_t (the code is older than C99) server-v6: * D6O_RELAY_PORT -> D6O_RELAY_SOURCE_PORT * 90 -> 135 * "Relay Port." (in messages) -> "Relay Source Port." I have two concerns about: + /* Check relay source port */ + if (packet->relay_source_port && packet->client_port != 547) { + to_addr.sin6_port = packet->client_port; + } First as the to_addr.sin6_port is always local_port so 547, second 547 is host byte order when packet->client_port is network byte order so the wrong test is useless if the relay doesn't use port 8962... I removed the second part leaving only packet->relay_source_port but I'd like to get your opinion about this.
Next patches: - Relay v4: * I kept the patching of the first 67 (index 8) * BTW the cast to short in ntohs() calls is not correct (fixed them around modified code) * I added a #error in other PF code (NDLI, NIT, etc) * missing trailing ']' in "[-p <port> | -rp <relay-port>" - Relay v6: * changed {up, down}_intf into {up, down}done * I am not convinced by the else before the break which matches more than needed but I don't believe it can harm so I didn't try to fix it. (down_intf++; in you patch) * changed "ipv6-relay-port" in "relay-source-port" and 90 in 135 and I reordered entries to increasing codes. * 547 -> htons(547) (compare to client_port) * relay-port -> relay-source-port in message I updated the manual page.
4o6 (last) patch: * changed rp_opt_exist in rsp_opt_exist (consistent with relay-port -> relay-source-port) * I don't believe this field is need: the option must be copied in the response so it is possible to check if it is still present. Note this means it is required to parse response before to forward them so it looks like an optimization for ISC DHCP (DHCPv4 over DHCPv6 support in Kea does not work (yet) with relays..) * I changed the sizeof's by literal: the current ISC DHCP code should be updated to use ISC space options to encapsulate extra informations between DHCPv6 and DHCPv4 parts: it was done for Kea but not (yet) for ISC DHCP for a silly reason: there are old and incompatible definitions for the ISC space... Global changes: I added a configure option (--enable-relay-port) for optional support at build time. I still have to write a RELNOTES entry to write...
On Wed Dec 20 12:24:53 2017, tmark wrote: > Your opt code values are fine and agree with what Tomek thinks IANA > will assign. > > > ... > > I removed the second part leaving only packet->relay_source_port > > but I'd like to get your opinion about this. > > I think this is ok. => the message was for Shen/Chen (:-).
Tested the DHCPv4 part with success. With a correct setup (server routing, dhcrelay with the 2 interfaces): - old ISC DHCP works but does not copy RAI relay port sub-option and sends replay to port 67 (expected behavior, it works because the relay is backward compatible and listen on both the relay port and the legacy port) - new ISC DHCP works, copies the RAI relay port and uses the port it receives queries from. - new Kea works, copies the RAI relay port and uses the port it receives queries from (I didn't check old Kea but it should behave in a similar way than old ISC DHCP). Tomorrow I'll try the DHCPv6 part.
Tested with DHCPv6 with one and two relays using legacy ports or relay ports: it works well as expected (for instance the port value is in the right byte order). Servers: modified ISC DHCP and modified Kea. Multicast can be a bit hairy: the first (near client) can't use multicast upstream, and with Kea the second and the server must be configured to use the unicast address. Note there is already a ticket about Kea listening on one (vs two as it should) multicast address. Retried with a legacy ISC DHCP: it still works (the relay listens on both ports) but the server sends replies at the legacy port (547) and omits the relay port option (exactly what it is expected to behave). Moving to DHCPv4-over-DHCPv6 but as it is not a critical feature I move tickets to the review queue.
Hello Naiming: The beta release of 4.4.0, which will contain your relay-port patch, should be available for download January 9, 2018. It should be available via our public repo before then. I can let you know when if you wish. We would very much like to get your feedback on whatever testing you may be able to perform. The feature is conditionally compiled out by default, but can be enabled by supplying --enable-relay-port to the configure script. We also had to use our best-guess values for IANA will assign for option codes: v4: RAI_RELAY_PORT 19 v6: D6O_RELAY_SOURCE_PORT 135 and as the draft hasn't been officially approved (but will), the feature is labeled as "experimental". You very much deserve to be recognized for your efforts on your patch. Typically we do this by citing the contributor in our release notes. If you would like to thanked in this manner, please respond with how you wish to be identified. Regards, Thomas Markwalder ISC Software Engineering
Repaired a bug in new DHCPv4-over-DHCPv6 where packet is used after being dereferenced. With the fix and forcing /64 prefix length on the client (I forgot to patch DHCLIENT_DEFAULT_PREFIX_LEN) it works well with modified ISC DHCP and Kea. Now testing with relays...
Date: Fri, 22 Dec 2017 19:50:04 +0000
From: "Naiming Shen (naiming)" <naiming@cisco.com>
CC: "Enke Chen (enkechen)" <enkechen@cisco.com>
Subject: Re: [ISC-Bugs #44535] Patch: DHCP relay port feature code for review (from Cisco - Support ticket #11062)
To: "dhcp-public@isc.org" <dhcp-public@isc.org>
Hi Thomas, > On Dec 22, 2017, at 7:56 AM, Thomas Markwalder via RT <dhcp-public@isc.org> wrote: > > Hello Naiming: > > The beta release of 4.4.0, which will contain your relay-port patch, should be available for download January 9, 2018. It should be available via our public repo before then. I can let you know when if you wish. > We would very much like to get your feedback on whatever testing you may be able to perform. NS> this is great. I’ve seen some emails about v4 and v6 testing on this, but I’m a little busy these days to read them carefully. I plan to go over them during the US holidays. Yes, please let me know when the software is available. I’ll see if I can spend some time to verify it. > > The feature is conditionally compiled out by default, but can be enabled by supplying --enable-relay-port to the configure script. We also had to use our best-guess values for IANA will assign for option codes: > > v4: RAI_RELAY_PORT 19 > v6: D6O_RELAY_SOURCE_PORT 135 > > and as the draft hasn't been officially approved (but will), the feature is labeled as "experimental”. NS> OK. > > You very much deserve to be recognized for your efforts on your patch. Typically we do this by citing the contributor in our release notes. If you would like to thanked in this manner, please respond with how you wish to be identified. NS> Sure. I think “Naiming Shen of Cisco Systems” should be good. Cheers, - Naiming > > Regards, > > Thomas Markwalder > ISC Software Engineering > >
Last message about tests: I tried DHCPv4-over-DHCPv6 with a DHCPv6 relay in the middle and ISC DHCP clients. Note I fixed a not critical bug: I copied some code to dhcpv4o6_relay_forw from dhcpv6_relay_forw (my fault, I missed this when I updated the 4o6 code). Everything is about the content of the dhcp4-o-dhcp6-server: - the natural option is to put the DHCPv6 server address and to rely in routing. I tried it even it bypasses the relay for 4o6 traffic but in fact it does not work because the DHCPv6 client is bound to the link-local address (the only one which should be available at cold start) and of course packets sourced by it can't cross routers. - I tried the empty option (i.e. use the multicast default). It works well even the client does not like empty address array in its lease file. - to enforce to use the first relay I had the idea to put its address in the option. In fact now I am convinced it is the best choice and I'll update the doc to mention it. About the relay port: the option is correctly copied from queries to responses, and the right port (vs legacy port) is used so I conclude with success. I tried with Kea: it works even I thought it could not but of course as I didn't updated the 4o6 code if the option is copied (for Kea expert I updated copyRelayInfo) but of course the legacy port is still used...
On Fri Dec 22 16:05:00 2017, tmark wrote: > relay/dhcrelay.c > -6 usage at line 168 does not list "-rp <relay-port>" => fixed. > The man page entry should probably mention that option code values > we're using and that the feature is "experimental". Is it worth > mentioning the RFC draft # as well? => I did this in the RELNOTES entry which is still temporary and should be finished before the code freeze. For the I-D full name I have done this since the period when I-Ds were removed from the repository on update or expire... > Building with and without --relay-port, unit tests all pass as do ISC > DHCP specific Forge tests. None of these tests excersize dhcrelay > though. => Relay is an essential feature on both DHCPv4 and DHCPv6 so I believe you mean dhcrelay itself. > I think you're ok to merge. => Merge to master with a temporary RELNOTES entry. See this next Friday/month/year?
Hi, The draft (draft-ietf-dhc-relay-port) is now approved by IESG and is awaiting publication. It's a slow time because of Christmas and New Year, so the code allocation takes longer than usual. To make sure IANA assigned the codes, I asked them to assign option codes early. If you look at IANA page, these are marked as temporary, but don't worry. They'll become permanent once the RFC is published. Here's what I got: Tomek, all, These early allocations are complete. We've registered the following: 19 DHCPv4 Relay Source Port Sub-Option (TEMPORARY - registered 2017-12-27, expires 2018-12-27) [draft-ietf-dhc-relay-port] Please see https://www.iana.org/assignments/bootp-dhcp-parameters 135 DHCPv6 Relay Source Port (TEMPORARY - registered 2017-12-27, expires 2018-12-27) [draft-ietf-dhc-relay-port] Please see https://www.iana.org/assignments/dhcpv6-parameters If the document hasn't been approved for publication by then, we'll contact you in December 2018 to ask whether you want to renew for another year. Any renewals after the first one would require IESG approval. Best regards, Sabrina Tanamal Senior IANA Services Specialist ----------- Please use those option codes when merging this patch. Tomek Mrugalski (with my DHC co-chair hat on)
On Tue Jan 02 12:02:45 2018, tomasz wrote: > These early allocations are complete. We've registered the following: => 19 and 135 are the code points we expected...
Committed to master. Closing.
To: "dhcp-public@isc.org" <dhcp-public@isc.org>
From: "Naiming Shen (naiming)" <naiming@cisco.com>
CC: "Enke Chen (enkechen)" <enkechen@cisco.com>
Date: Tue, 2 Jan 2018 19:16:22 +0000
Subject: Re: [ISC-Bugs #44535] Patch: DHCP relay port feature code for review (from Cisco - Support ticket #11062)
Thanks Tomek for getting the earlier reservation of the codes. Happy New Year! Cheers, - Naiming > On Jan 2, 2018, at 4:02 AM, Tomasz Mrugalski via RT <dhcp-public@isc.org> wrote: > > Hi, > > The draft (draft-ietf-dhc-relay-port) is now approved by IESG and is awaiting publication. It's a slow time because of Christmas and New Year, so the code allocation takes longer than usual. To make sure IANA assigned the codes, I asked them to assign option codes early. If you look at IANA page, these are marked as temporary, but don't worry. They'll become permanent once the RFC is published. Here's what I got: > > Tomek, all, > > These early allocations are complete. We've registered the following: > > 19 DHCPv4 Relay Source Port Sub-Option (TEMPORARY - registered 2017-12-27, expires 2018-12-27) [draft-ietf-dhc-relay-port] > > Please see > https://www.iana.org/assignments/bootp-dhcp-parameters > > 135 DHCPv6 Relay Source Port (TEMPORARY - registered 2017-12-27, expires 2018-12-27) [draft-ietf-dhc-relay-port] > > Please see > https://www.iana.org/assignments/dhcpv6-parameters > > If the document hasn't been approved for publication by then, we'll contact you in December 2018 to ask whether you want to renew for another year. Any renewals after the first one would require IESG approval. > > Best regards, > > Sabrina Tanamal > Senior IANA Services Specialist > > ----------- > > Please use those option codes when merging this patch. > > Tomek Mrugalski > (with my DHC co-chair hat on)