AW: [PATCH] udhcpc: Add support to change default interface name

Andre Kalb Andre.Kalb at sma.de
Mon Jul 13 13:23:28 UTC 2020


Hello,

friendly patch reminder.

http://lists.busybox.net/pipermail/busybox/2020-May/087945.html

Best regards
Andre Kalb

-----Ursprüngliche Nachricht-----
Von: Andre Kalb <svc.sw.rte.linux at sma.de> 
Gesendet: Dienstag, 5. Mai 2020 18:24
An: busybox at busybox.net
Betreff: [PATCH] udhcpc: Add support to change default interface name


Signed-off-by: Andre Kalb <Andre.Kalb at sma.de>
---
 networking/udhcp/Config.src | 8 ++++++++  networking/udhcp/d6_dhcpc.c | 4 ++-- 
 networking/udhcp/dhcpc.c    | 4 ++-- 
 3 files changed, 12 insertions(+), 4 deletions(-) 

diff --git a/networking/udhcp/Config.src b/networking/udhcp/Config.src index 8ef24748e..ec52b1668 100644
--- a/networking/udhcp/Config.src 
+++ b/networking/udhcp/Config.src
@@ -100,6 +100,14 @@ config UDHCPC_DEFAULT_SCRIPT 
        examples/udhcp for a working example. Normally it is safe 
        to leave this untouched. 
  
+config UDHCPC_DEFAULT_INTERFACE 
+       string "Default interface name" 
+       default "eth0" 
+       depends on UDHCPC || UDHCPC6 
+       help 
+       The interface that will be used if no other interface is 
+       specified on the commandline. 
+ 
 # udhcpc6 config is inserted here: 
 INSERT 
  
diff --git a/networking/udhcp/d6_dhcpc.c b/networking/udhcp/d6_dhcpc.c index 85c410a7c..285c6c4cd 100644
--- a/networking/udhcp/d6_dhcpc.c 
+++ b/networking/udhcp/d6_dhcpc.c
@@ -1162,7 +1162,7 @@ static void client_background(void) 
 //usage:       "[-fbnq"IF_UDHCP_VERBOSE("v")"odR] [-i IFACE] [-r IPv6]
[-s PROG] [-p PIDFILE]\n" 
 //usage:       "       [-x OPT:VAL]... [-O OPT]..."
IF_FEATURE_UDHCP_PORT(" [-P N]")
 //usage:#define udhcpc6_full_usage "\n" 
-//usage:     "\n       -i IFACE        Interface to use (default
eth0)" 
+//usage:     "\n       -i IFACE        Interface to use (default
"CONFIG_UDHCPC_DEFAULT_INTERFACE")" 
 //usage:     "\n       -p FILE         Create pidfile" 
 //usage:     "\n       -s PROG         Run PROG at DHCP events
(default "CONFIG_UDHCPC_DEFAULT_SCRIPT")" 
 //usage:     "\n       -B              Request broadcast replies" 
@@ -1230,7 +1230,7 @@ int udhcpc6_main(int argc UNUSED_PARAM, char
**argv) 
        /* Default options */ 
        IF_FEATURE_UDHCP_PORT(SERVER_PORT6 = 547;) 
        IF_FEATURE_UDHCP_PORT(CLIENT_PORT6 = 546;) 
-       client_data.interface = "eth0"; 
+       client_data.interface = CONFIG_UDHCPC_DEFAULT_INTERFACE;
        client_data.script = CONFIG_UDHCPC_DEFAULT_SCRIPT; 
        client_data.sockfd = -1; 
  
diff --git a/networking/udhcp/dhcpc.c b/networking/udhcp/dhcpc.c index 5a1f8fd7a..a06320242 100644
--- a/networking/udhcp/dhcpc.c 
+++ b/networking/udhcp/dhcpc.c
@@ -1202,7 +1202,7 @@ static void client_background(void) 
 //usage:       "       [-i IFACE]"IF_FEATURE_UDHCP_PORT(" [-P PORT]")"
[-s PROG] [-p PIDFILE]\n" 
 //usage:       "       [-oC] [-r IP] [-V VENDOR] [-F NAME] [-x
OPT:VAL]... [-O OPT]..." 
 //usage:#define udhcpc_full_usage "\n" 
-//usage:     "\n       -i IFACE        Interface to use (default
eth0)" 
+//usage:     "\n       -i IFACE        Interface to use (default
"CONFIG_UDHCPC_DEFAULT_INTERFACE")" 
 //usage:       IF_FEATURE_UDHCP_PORT( 
 //usage:     "\n       -P PORT         Use PORT (default 68)" 
 //usage:       ) 
@@ -1271,7 +1271,7 @@ int udhcpc_main(int argc UNUSED_PARAM, char
**argv) 
        /* Default options */ 
        IF_FEATURE_UDHCP_PORT(SERVER_PORT = 67;) 
        IF_FEATURE_UDHCP_PORT(CLIENT_PORT = 68;) 
-       client_data.interface = "eth0"; 
+       client_data.interface = CONFIG_UDHCPC_DEFAULT_INTERFACE;
        client_data.script = CONFIG_UDHCPC_DEFAULT_SCRIPT; 
        client_data.sockfd = -1; 
        str_V = "udhcp "BB_VER;
--
2.19.2.windows.1 

-------------- next part --------------
A non-text attachment was scrubbed...
Name: openpgp-digital-signature.asc
Type: application/pgp-signature
Size: 489 bytes
Desc: not available
URL: <http://lists.busybox.net/pipermail/busybox/attachments/20200713/cdd835db/attachment.asc>


More information about the busybox mailing list