RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1757247 - DHCPv6 relay-fwd requests are ignored by dnsmasq
Summary: DHCPv6 relay-fwd requests are ignored by dnsmasq
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: dnsmasq
Version: 7.9
Hardware: Unspecified
OS: Unspecified
medium
high
Target Milestone: rc
: ---
Assignee: Petr Menšík
QA Contact: Petr Sklenar
URL:
Whiteboard:
Depends On:
Blocks: 1711384 1780577
TreeView+ depends on / blocked
 
Reported: 2019-09-30 23:42 UTC by Harald Jensås
Modified: 2022-12-16 19:03 UTC (History)
5 users (show)

Fixed In Version: dnsmasq-2.76-13.el7
Doc Type: No Doc Update
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-09-29 19:31:26 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker RHELPLAN-53478 0 None None None 2022-12-16 19:03:16 UTC
Red Hat Product Errata RHSA-2020:3878 0 None None None 2020-09-29 19:33:45 UTC

Description Harald Jensås 2019-09-30 23:42:19 UTC
Description of problem:
When trying to use ICS dhcrelay (or dnsmasq itself) to relay DHCPv6 info-req to a dnsmasq DHCP server the relay-fwd packages are ignored by dnsmasq.

Version-Release number of selected component (if applicable):
dnsmasq-2.76-9.el7.x86_64

How reproducible:
100%

Steps to Reproduce:
1. Install DHCP server with ipv6 address on eth1, and below dnsmasq.conf

[root@pxe-server ~]# ip6tables -F  # Drop the firewall, alternative open udp ports 546 and 547.

[root@pxe-server ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth1 
DEVICE=eth1
NAME=eth1
TYPE=Ethernet
ONBOOT=yes
NM_CONTROLLED=no
HOTPLUG=no
PEERDNS=no
IPV6INIT=yes
IPV6_AUTOCONF=no
IPV6ADDR=fd12:3456:789a:1::1/64

[root@pxe-server ~]# cat /etc/dnsmasq.conf 
port=0
interface=eth1

dhcp-range=set:ctlplane-subnet,fd12:3456:789a:1::aaaa,fd12:3456:789a:1::ffff,64,10m
dhcp-range=set:ctlplane-subnet2,fd12:3456:789a:2::aaaa,fd12:3456:789a:2::ffff,64,10m
# dhcp-option=tag:ctlplane-subnet,option6:3,[fd12:3456:789a:1::fffe]
dhcp-match=set:ipv6,option6:1
dhcp-userclass=set:ipxe6,iPXE
dhcp-option=tag:ipxe6,option6:bootfile-url,http://[fd12:3456:789a:1::1]:8000/inspector.ipxe
dhcp-option=tag:ipv6,option6:bootfile-url,tftp://[fd12:3456:789a:1::1]/ipxe.efi
dhcp-sequential-ip

2. Install radvd and dhcrelay node with ipv6 on eth1 and eth2. eth1 is on same L2 segment as eth1 on the dhcp server.

[root@dhcp6-relay ~]# ip6tables -F  # Drop the firewall, alternative open udp ports 546 and 547.

[root@dhcp6-relay ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth1 
DEVICE=eth1
NAME=eth1
TYPE=Ethernet
ONBOOT=yes
NM_CONTROLLED=no
HOTPLUG=no
PEERDNS=no
IPV6INIT=yes
IPV6_AUTOCONF=no
IPV6ADDR=fd12:3456:789a:1::2/64

[root@dhcp6-relay ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth2
DEVICE=eth2
NAME=eth2
TYPE=Ethernet
ONBOOT=yes
NM_CONTROLLED=no
HOTPLUG=no
PEERDNS=no
IPV6INIT=yes
IPV6_AUTOCONF=no
IPV6ADDR=fd12:3456:789a:2::1/64

[root@dhcp6-relay ~]# cat /etc/radvd.conf 
interface eth1 {
  AdvSendAdvert on;
  AdvRASolicitedUnicast on;
  AdvManagedFlag off;
  AdvOtherConfigFlag on;
  prefix fd12:3456:789a:1::/64 {
  };
};

interface eth2 {
  AdvSendAdvert on;
  AdvRASolicitedUnicast on;
  AdvManagedFlag off;
  AdvOtherConfigFlag on;
  prefix fd12:3456:789a:2::/64 {
  };
};

[root@dhcp6-relay ~]# sysctl net.ipv6.conf.eth1.forwarding=1
[root@dhcp6-relay ~]# sysctl net.ipv6.conf.eth2.forwarding=1

[root@dhcp6-relay ~]# systemctl restart radvd

2.1. Start the DHCPv6 relay ...

[root@dhcp6-relay ~]#  dhcrelay -6 -d --no-pid -u eth1 -l eth2  

Actual results:
Dropped all unnecessary capabilities.
Internet Systems Consortium DHCP Relay Agent 4.2.5
Copyright 2004-2013 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/
Bound to *:547
Listening on Socket/eth2
Sending on   Socket/eth2
Listening on Socket/eth1
Sending on   Socket/eth1
Setting hop count limit to 32 for interface eth1
Dropped all capabilities.
Relaying Solicit from fe80::5054:ff:fe50:f586 port 546 going up.
Relaying Information-request from fe80::5054:ff:fe50:f586 port 546 going up.
Relaying Solicit from fe80::5054:ff:fe50:f586 port 546 going up.
Relaying Information-request from fe80::5054:ff:fe50:f586 port 546 going up.
Relaying Solicit from fe80::5054:ff:fe50:f586 port 546 going up.
Relaying Information-request from fe80::5054:ff:fe50:f586 port 546 going up.

++ dnsmasq logs: (Nothing is logged)


Expected results:
Dropped all unnecessary capabilities.
Internet Systems Consortium DHCP Relay Agent 4.2.5
Copyright 2004-2013 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/
Bound to *:547
Listening on Socket/eth2
Sending on   Socket/eth2
Listening on Socket/eth1
Sending on   Socket/eth1
Setting hop count limit to 32 for interface eth1
Dropped all capabilities.
Relaying Information-request from fe80::5054:ff:fe50:f586 port 546 going up.
Relaying Reply to fe80::5054:ff:fe50:f586 port 546 down.
Relaying Solicit from fe80::5054:ff:fe50:f586 port 546 going up.
Relaying Advertise to fe80::5054:ff:fe50:f586 port 546 down.
Relaying Request from fe80::5054:ff:fe50:f586 port 546 going up.
Relaying Reply to fe80::5054:ff:fe50:f586 port 546 down.
Relaying Release from fe80::5054:ff:fe50:f586 port 546 going up.
Relaying Reply to fe80::5054:ff:fe50:f586 port 546 down.


++ dnsmasq logs:
dnsmasq-dhcp: DHCPINFORMATION-REQUEST(eth1) 00:04:c4:4d:7a:ed:13:a4:ad:49:ba:27:61:7c:ff:09:d1:b2 
dnsmasq-dhcp: DHCPSOLICIT(eth1) 00:04:c4:4d:7a:ed:13:a4:ad:49:ba:27:61:7c:ff:09:d1:b2 
dnsmasq-dhcp: DHCPADVERTISE(eth1) fd12:3456:789a:2::aaab 00:04:c4:4d:7a:ed:13:a4:ad:49:ba:27:61:7c:ff:09:d1:b2 
dnsmasq-dhcp: DHCPREQUEST(eth1) 00:04:c4:4d:7a:ed:13:a4:ad:49:ba:27:61:7c:ff:09:d1:b2 
dnsmasq-dhcp: DHCPREPLY(eth1) fd12:3456:789a:2::aaab 00:04:c4:4d:7a:ed:13:a4:ad:49:ba:27:61:7c:ff:09:d1:b2 
dnsmasq-dhcp: DHCPRELEASE(eth1) 00:04:c4:4d:7a:ed:13:a4:ad:49:ba:27:61:7c:ff:09:d1:b2 


Additional info:
Compiling dnsmask from git, 2.80-75-ge710c34 fixes the problem.

git clone git://thekelleys.org.uk/dnsmasq.git 
cd dnsmasq/
make PREFIX=$HOME install

Comment 2 Harald Jensås 2019-10-01 07:24:55 UTC
This would most likely be fixed by applying:

commit 499d8dde2b1a216eab9252ee500cc31b8c2b2974
Author: yiwenchen <yiwenchen>
Date:   Wed Feb 14 22:26:54 2018 +0000

    Fix boundary for test introduced in 3e3f1029c9ec6c63e430ff51063a6301d4b2262
    
    This fixes breakage of  DHCPv6 relay.

diff --git a/src/rfc3315.c b/src/rfc3315.c
index c3c1c95..21fcd9b 100644
--- a/src/rfc3315.c
+++ b/src/rfc3315.c
@@ -216,9 +216,9 @@ static int dhcp6_maybe_relay(struct state *state, void *inbuff, size_t sz,
   
   for (opt = opts; opt; opt = opt6_next(opt, end))
     {
-      if (opt6_ptr(opt, 0) + opt6_len(opt) >= end) {
+      if (opt6_ptr(opt, 0) + opt6_len(opt) > end) 
         return 0;
-      }
+     
       int o = new_opt6(opt6_type(opt));
       if (opt6_type(opt) == OPTION6_RELAY_MSG)
        {

Comment 3 Harald Jensås 2019-10-01 12:15:47 UTC
Result when testing with: dnsmasq-2.76-2.el7.x86_64

Oct 01 14:09:26 pxe-server.lab.example.com dnsmasq[1345]: started, version 2.76 DNS disabled
Oct 01 14:09:26 pxe-server.lab.example.com dnsmasq[1345]: compile time options: IPv6 GNU-getopt DBus no-i18n IDN DHCP DHCPv6 no-Lua TFTP no-conntrack ipset auth no-DNSSEC loop-detect inotify
Oct 01 14:09:26 pxe-server.lab.example.com dnsmasq-dhcp[1345]: DHCPv6, IP range fd12:3456:789a:2::aaaa -- fd12:3456:789a:2::ffff, lease time 10m
Oct 01 14:09:26 pxe-server.lab.example.com dnsmasq-dhcp[1345]: DHCPv6, IP range fd12:3456:789a:1::aaaa -- fd12:3456:789a:1::ffff, lease time 10m
Oct 01 14:09:47 pxe-server.lab.example.com dnsmasq-dhcp[1345]: DHCPINFORMATION-REQUEST(eth1) 00:04:c4:4d:7a:ed:13:a4:ad:49:ba:27:61:7c:ff:09:d1:b2
Oct 01 14:10:48 pxe-server.lab.example.com dnsmasq-dhcp[1345]: DHCPSOLICIT(eth1) 00:04:c4:4d:7a:ed:13:a4:ad:49:ba:27:61:7c:ff:09:d1:b2
Oct 01 14:10:48 pxe-server.lab.example.com dnsmasq-dhcp[1345]: DHCPADVERTISE(eth1) fd12:3456:789a:2::aaaa 00:04:c4:4d:7a:ed:13:a4:ad:49:ba:27:61:7c:ff:09:d1:b2
Oct 01 14:10:53 pxe-server.lab.example.com dnsmasq-dhcp[1345]: DHCPREQUEST(eth1) 00:04:c4:4d:7a:ed:13:a4:ad:49:ba:27:61:7c:ff:09:d1:b2
Oct 01 14:10:53 pxe-server.lab.example.com dnsmasq-dhcp[1345]: DHCPREPLY(eth1) fd12:3456:789a:2::aaaa 00:04:c4:4d:7a:ed:13:a4:ad:49:ba:27:61:7c:ff:09:d1:b2
Oct 01 14:11:24 pxe-server.lab.example.com dnsmasq-dhcp[1345]: DHCPRELEASE(eth1) 00:04:c4:4d:7a:ed:13:a4:ad:49:ba:27:61:7c:ff:09:d1:b2


Result when testing with: dnsmasq-2.76-5.el7.x86_64

Oct 01 14:13:27 pxe-server.lab.example.com dnsmasq[1391]: started, version 2.76 DNS disabled
Oct 01 14:13:27 pxe-server.lab.example.com dnsmasq[1391]: compile time options: IPv6 GNU-getopt DBus no-i18n IDN DHCP DHCPv6 no-Lua TFTP no-conntrack ipset auth no-DNSSEC loop-detect inotify
Oct 01 14:13:27 pxe-server.lab.example.com dnsmasq-dhcp[1391]: DHCPv6, IP range fd12:3456:789a:2::aaaa -- fd12:3456:789a:2::ffff, lease time 10m
Oct 01 14:13:27 pxe-server.lab.example.com dnsmasq-dhcp[1391]: DHCPv6, IP range fd12:3456:789a:1::aaaa -- fd12:3456:789a:1::ffff, lease time 10m

Comment 20 errata-xmlrpc 2020-09-29 19:31:26 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Low: dnsmasq security and bug fix update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2020:3878


Note You need to log in before you can comment on or make changes to this bug.