summaryrefslogtreecommitdiff
blob: 5736a5e6f1dd45fc9a81dceafed926d2c07ea507 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
diff -uNr dhcpcd-1.3.22-pl4.orig/client.c dhcpcd-1.3.22-pl4/client.c
--- dhcpcd-1.3.22-pl4.orig/client.c	2003-11-12 13:19:38.000000000 +0100
+++ dhcpcd-1.3.22-pl4/client.c	2003-11-12 14:39:45.000000000 +0100
@@ -73,6 +73,7 @@
 extern	int		resolv_renamed,yp_renamed,ntp_renamed;
 extern	int		InitialHostName_len,InitialDomainName_len;
 extern	char		*InitialHostName,*InitialDomainName;
+extern	int		DownIfaceOnStop;
 
 #if 0
 extern	unsigned char	ClientMACaddr[ETH_ALEN];
@@ -1142,9 +1143,12 @@
   if ( ioctl(dhcpSocket,SIOCSIFADDR,&ifr) == -1 )
     syslog(LOG_ERR,"dhcpStop: ioctl SIOCSIFADDR: %m\n");
 #endif
-  ifr.ifr_flags = saved_if_flags & ~IFF_UP;
-  if ( (IfName_len==IfNameExt_len) && ioctl(dhcpSocket,SIOCSIFFLAGS,&ifr) )
-    syslog(LOG_ERR,"dhcpStop: ioctl SIOCSIFFLAGS: %m\n");
+  if (DownIfaceOnStop)
+    {
+      ifr.ifr_flags = saved_if_flags & ~IFF_UP;
+      if ( (IfName_len==IfNameExt_len) && ioctl(dhcpSocket,SIOCSIFFLAGS,&ifr) )
+        syslog(LOG_ERR,"dhcpStop: ioctl SIOCSIFFLAGS: %m\n");
+    }
 tsc:
   close(dhcpSocket);
   if ( resolv_renamed )
diff -uNr dhcpcd-1.3.22-pl4.orig/dhcpcd.8 dhcpcd-1.3.22-pl4/dhcpcd.8
--- dhcpcd-1.3.22-pl4.orig/dhcpcd.8	2003-11-12 13:19:38.000000000 +0100
+++ dhcpcd-1.3.22-pl4/dhcpcd.8	2003-11-12 14:39:45.000000000 +0100
@@ -9,7 +9,7 @@
 .in +.5i
 .ti -.5i
 dhcpcd
-\%[\-dknrzBCDHNRSTY]
+\%[\-dknorzBCDHNRSTY]
 \%[\-t\ <timeout>]
 \%[\-c\ <ExecFilePath>]
 \%[-h\ <hostname>]
@@ -121,6 +121,13 @@
 .B dhcpcd
 follows the normal startup procedure.
 .TP
+.BI \-o
+Prevents
+.B dhcpcd
+from bringing
+.B interface
+down on exit.
+.TP
 .BI \-r
 Makes dhcpcd RFC1541 (obsolete) compliant.
 .B dhcpcd
diff -uNr dhcpcd-1.3.22-pl4.orig/dhcpcd.c dhcpcd-1.3.22-pl4/dhcpcd.c
--- dhcpcd-1.3.22-pl4.orig/dhcpcd.c	2003-11-12 13:19:38.000000000 +0100
+++ dhcpcd-1.3.22-pl4/dhcpcd.c	2003-11-12 15:20:11.000000000 +0100
@@ -70,6 +70,7 @@
 int		Window		=	0;
 char		*ConfigDir	=	CONFIG_DIR;
 int		SetDHCPDefaultRoutes=	1;
+int		DownIfaceOnStop	=	1;
 #if 0
 unsigned char	ClientMACaddr[ETH_ALEN];
 int		ClientMACaddr_ind =	0;
@@ -326,10 +327,14 @@
 	      goto usage;
 	    s=1;
 	    if ( LeaseTime > 0 ) break;
+	  case 'o':
+	    s++;
+	    DownIfaceOnStop=0;
+	    break;
           default:
 usage:	    print_version();
 	    fprintf(stderr,
-"Usage: dhcpcd [-dknrzBCDHNRSTY] [-l leasetime] [-h hostname] [-t timeout]\n\
+"Usage: dhcpcd [-dknorzBCDHNRSTY] [-l leasetime] [-h hostname] [-t timeout]\n\
        [-i vendorClassID] [-I ClientID] [-c filename] [-s [ipaddr]]\n\
        [-w windowsize] [-L ConfigDir] [-G [gateway]] [interface]\n");
 	    exit(1);