Subject: | dhcrelay v6: No route to host |
Date: | Thu, 16 Jul 2015 16:41:53 -0500 |
To: | dhcp-bugs@isc.org |
From: | "vladv" <vladv@rvtn.org> |
On OpenBSD 5.7, with ISC DHCP 4.3.2, the DHCP relay does not
properly forward packets to the downstream interface, instead
logging "send_packet6: No route to host". Indeed, a proper route to
the host exists, and connectivity is confirmed. Instead, it appears
that dhcrelay is not properly setting the sin6_scope_id for the
outbound packet.
An example follows:
# sbin/dhcrelay -d -6 -l vlan3930 -u vlan3920
Internet Systems Consortium DHCP Relay Agent 4.3.2
Copyright 2004-2015 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/
Bound to *:547
Listening on Socket/vlan3920
Sending on Socket/vlan3920
Listening on Socket/vlan3930
Sending on Socket/vlan3930
Setting hop count limit to 32 for interface vlan3920
Relaying Solicit from fe80::fd8d:a178:51dd:601 port 546 going up.
Relaying Advertise to fe80::fd8d:a178:51dd:601 port 546 down.
send_packet6: No route to host
Relaying Solicit from fe80::fd8d:a178:51dd:601 port 546 going up.
Relaying Advertise to fe80::fd8d:a178:51dd:601 port 546 down.
send_packet6: No route to host
Relaying Solicit from fe80::fd8d:a178:51dd:601 port 546 going up.
Relaying Advertise to fe80::fd8d:a178:51dd:601 port 546 down.
send_packet6: No route to host
Relaying Solicit from fe80::fd8d:a178:51dd:601 port 546 going up.
Relaying Advertise to fe80::fd8d:a178:51dd:601 port 546 down.
send_packet6: No route to host
----------
I was able to rectify the issue by modifying common/socket.c to
set the sin6_scope_id in all cases:
# diff -up common/socket.c.orig common/socket.c
--- common/socket.c.orig Thu Jul 16 10:29:06 2015
+++ common/socket.c Thu Jul 16 10:29:52 2015
@@ -794,8 +794,7 @@ ssize_t send_packet6(struct interface_info *interface,
m.msg_name = &dst;
m.msg_namelen = sizeof(dst);
ifindex = if_nametoindex(interface->name);
- if (no_global_v6_socket)
- dst.sin6_scope_id = ifindex;
+ dst.sin6_scope_id = ifindex;
/*
* Set the data buffer we're sending. (Using this wacky
----------
The patched dhcrelay works as expected:
# sbin/dhcrelay -d -6 -l vlan3930 -u vlan3920
Internet Systems Consortium DHCP Relay Agent 4.3.2
Copyright 2004-2015 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/
Bound to *:547
Listening on Socket/vlan3920
Sending on Socket/vlan3920
Listening on Socket/vlan3930
Sending on Socket/vlan3930
Setting hop count limit to 32 for interface vlan3920
Relaying Solicit from fe80::fd8d:a178:51dd:601 port 546 going up.
Relaying Advertise to fe80::fd8d:a178:51dd:601 port 546 down.
Relaying Request from fe80::fd8d:a178:51dd:601 port 546 going up.
Relaying Reply to fe80::fd8d:a178:51dd:601 port 546 down.
Relaying Renew from fe80::fd8d:a178:51dd:601 port 546 going up.
Relaying Reply to fe80::fd8d:a178:51dd:601 port 546 down.
----------
I do not know the consequences of always setting sin6_scope_id
on the operation of dhclient or dhcpd, nor have I tested it on systems
other than OpenBSD.
Best,
Vladimir Voskoboynikov
Message body not shown because it is not plain text.
Message body not shown because it is not plain text.