Don't use BINDTODEVICE on DHCP socket when relaying.

This commit is contained in:
Simon Kelley
2013-09-05 20:08:01 +01:00
parent 831b5ba12b
commit 10ae7b50f2

View File

@@ -237,16 +237,17 @@ int main (int argc, char **argv)
#if defined(HAVE_LINUX_NETWORK) && defined(HAVE_DHCP) #if defined(HAVE_LINUX_NETWORK) && defined(HAVE_DHCP)
/* after enumerate_interfaces() */ /* after enumerate_interfaces() */
if (daemon->dhcp || daemon->relay4) if (daemon->dhcp)
{ {
bindtodevice(daemon->dhcpfd); if (!daemon->relay4)
bindtodevice(daemon->dhcpfd);
if (daemon->enable_pxe) if (daemon->enable_pxe)
bindtodevice(daemon->pxefd); bindtodevice(daemon->pxefd);
} }
#endif #endif
#if defined(HAVE_LINUX_NETWORK) && defined(HAVE_DHCP6) #if defined(HAVE_LINUX_NETWORK) && defined(HAVE_DHCP6)
if (daemon->doing_dhcp6 || daemon->relay6) if (daemon->doing_dhcp6 && !daemon->relay6)
bindtodevice(daemon->dhcp6fd); bindtodevice(daemon->dhcp6fd);
#endif #endif
} }