[prev in list] [next in list] [prev in thread] [next in thread] 

List:       dhcp-hackers
Subject:    dhclient: purpose of fallback_interface
From:       Ulrich Weber <ulrich.weber () sophos ! com>
Date:       2011-11-09 16:54:02
Message-ID: 4EBAB02A.5020800 () sophos ! com
[Download RAW message or body]

Hi,

whats the purpose of the fallback_interface in the
dhclient code? I couldn't find a way to disable it.

With fallback_interface set, RENEW/REBIND messages
might be sent over the wrong interface, if there are
multiple Uplinks and the DHCP server address is not within
the same network as the Uplink interface.

Deactivating fallback_interface in send_request/send_release
forces the Source IP address to the IP address of the correct
interface and packets are routed correctly.

Cheers
  Ulrich

-- 
Ulrich Weber |ulrich.weber@sophos.com  | Senior Software Engineer
Astaro - a Sophos company | Amalienbadstr 41 | 76227 Karlsruhe | Germany
Phone +49-721-25516-0 | Fax –200 |www.astaro.com


["dhclient-dont-use-fallback-interface.patch" (text/x-patch)]

From f5809c1186b16e60040fc55cf3c14c0c035c91a2 Mon Sep 17 00:00:00 2001
From: Ulrich Weber <uweber@astaro.com>
Date: Tue, 10 May 2011 10:39:26 +0200
Subject: [PATCH] dhclient: dont use fallback interface

otherwise source address is not set and RENEW/REBIND
might be send out via wrong interface (if Uplink Balancing
is enabled)

Signed-off-by: Ulrich Weber <uweber@astaro.com>
---
 client/dhclient.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/client/dhclient.c b/client/dhclient.c
index 7f28ffd..4a10e74 100644
--- a/client/dhclient.c
+++ b/client/dhclient.c
@@ -2099,7 +2099,7 @@ void send_request (cpp)
 	      inet_ntoa (destination.sin_addr),
 	      ntohs (destination.sin_port));
 
-	if (destination.sin_addr.s_addr != INADDR_BROADCAST &&
+	if (0 && destination.sin_addr.s_addr != INADDR_BROADCAST &&
 	    fallback_interface)
 		result = send_packet (fallback_interface,
 				      (struct packet *)0,
@@ -2175,7 +2175,7 @@ void send_release (cpp)
 	      inet_ntoa (destination.sin_addr),
 	      ntohs (destination.sin_port));
 
-	if (fallback_interface)
+	if (0 && fallback_interface)
 		result = send_packet (fallback_interface,
 				      (struct packet *)0,
 				      &client -> packet,
-- 
1.7.4.2



_______________________________________________
dhcp-hackers mailing list
dhcp-hackers@lists.isc.org
https://lists.isc.org/mailman/listinfo/dhcp-hackers

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic