File tree Expand file tree Collapse file tree 2 files changed +18
-4
lines changed Expand file tree Collapse file tree 2 files changed +18
-4
lines changed Original file line number Diff line number Diff line change @@ -1020,10 +1020,18 @@ dhcpcd_open(DHCPCD_CONNECTION *con, bool privileged)
1020
1020
errno = EISCONN ;
1021
1021
return -1 ;
1022
1022
}
1023
+
1023
1024
/* We need to block the command fd */
1024
1025
con -> command_fd = dhcpcd_connect (path , 0 );
1025
- if (con -> command_fd == -1 )
1026
- goto err_exit ;
1026
+ if (con -> command_fd == -1 ) {
1027
+ if (errno == ENOENT ) {
1028
+ path = privileged ?
1029
+ DHCPCD_OSOCKET : DHCPCD_UNPRIV_OSOCKET ;
1030
+ con -> command_fd = dhcpcd_connect (path , 0 );
1031
+ }
1032
+ if (con -> command_fd == -1 )
1033
+ goto err_exit ;
1034
+ }
1027
1035
1028
1036
con -> terminate_commands = false;
1029
1037
if (dhcpcd_ctrl_command (con , "--version" , & con -> version ) <= 0 )
Original file line number Diff line number Diff line change @@ -37,10 +37,16 @@ extern "C" {
37
37
#endif
38
38
39
39
#ifndef DHCPCD_SOCKET
40
- #define DHCPCD_SOCKET "/var/run/dhcpcd. sock"
40
+ #define DHCPCD_SOCKET "/var/run/dhcpcd/ sock"
41
41
#endif
42
42
#ifndef DHCPCD_UNPRIV_SOCKET
43
- #define DHCPCD_UNPRIV_SOCKET "/var/run/dhcpcd.unpriv.sock"
43
+ #define DHCPCD_UNPRIV_SOCKET "/var/run/dhcpcd/unpriv.sock"
44
+ #endif
45
+ #ifndef DHCPCD_OSOCKET
46
+ #define DHCPCD_OSOCKET "/var/run/dhcpcd.sock"
47
+ #endif
48
+ #ifndef DHCPCD_UNPRIV_OSOCKET
49
+ #define DHCPCD_UNPRIV_OSOCKET "/var/run/dhcpcd.unpriv.sock"
44
50
#endif
45
51
46
52
#ifndef WPA_CTRL_DIR
You can’t perform that action at this time.
0 commit comments