@@ -96,17 +96,17 @@ static int add_next_to_inflatable_buffer(struct inflatable_buffer *buffer)
9696}
9797
9898#ifndef WINCOMPAT
99- static FILE * userspace_interface_file (const char * interface )
99+ static FILE * userspace_interface_file (const char * iface )
100100{
101101 struct stat sbuf ;
102102 struct sockaddr_un addr = { .sun_family = AF_UNIX };
103103 int fd = -1 , ret ;
104104 FILE * f = NULL ;
105105
106106 errno = EINVAL ;
107- if (strchr (interface , '/' ))
107+ if (strchr (iface , '/' ))
108108 goto out ;
109- ret = snprintf (addr .sun_path , sizeof (addr .sun_path ), SOCK_PATH "%s" SOCK_SUFFIX , interface );
109+ ret = snprintf (addr .sun_path , sizeof (addr .sun_path ), SOCK_PATH "%s" SOCK_SUFFIX , iface );
110110 if (ret < 0 )
111111 goto out ;
112112 ret = stat (addr .sun_path , & sbuf );
@@ -140,15 +140,15 @@ static FILE *userspace_interface_file(const char *interface)
140140 return f ;
141141}
142142
143- static bool userspace_has_wireguard_interface (const char * interface )
143+ static bool userspace_has_wireguard_interface (const char * iface )
144144{
145145 struct stat sbuf ;
146146 struct sockaddr_un addr = { .sun_family = AF_UNIX };
147147 int fd , ret ;
148148
149- if (strchr (interface , '/' ))
149+ if (strchr (iface , '/' ))
150150 return false;
151- if (snprintf (addr .sun_path , sizeof (addr .sun_path ), SOCK_PATH "%s" SOCK_SUFFIX , interface ) < 0 )
151+ if (snprintf (addr .sun_path , sizeof (addr .sun_path ), SOCK_PATH "%s" SOCK_SUFFIX , iface ) < 0 )
152152 return false;
153153 if (stat (addr .sun_path , & sbuf ) < 0 )
154154 return false;
@@ -288,7 +288,7 @@ static int userspace_set_device(struct wgdevice *dev)
288288 num; \
289289})
290290
291- static int userspace_get_device (struct wgdevice * * out , const char * interface )
291+ static int userspace_get_device (struct wgdevice * * out , const char * iface )
292292{
293293 struct wgdevice * dev ;
294294 struct wgpeer * peer = NULL ;
@@ -302,14 +302,14 @@ static int userspace_get_device(struct wgdevice **out, const char *interface)
302302 if (!dev )
303303 return - errno ;
304304
305- f = userspace_interface_file (interface );
305+ f = userspace_interface_file (iface );
306306 if (!f )
307307 return - errno ;
308308
309309 fprintf (f , "get=1\n\n" );
310310 fflush (f );
311311
312- strncpy (dev -> name , interface , IFNAMSIZ - 1 );
312+ strncpy (dev -> name , iface , IFNAMSIZ - 1 );
313313 dev -> name [IFNAMSIZ - 1 ] = '\0' ;
314314
315315 while (getline (& key , & line_buffer_len , f ) > 0 ) {
@@ -889,7 +889,7 @@ static void coalesce_peers(struct wgdevice *device)
889889 }
890890}
891891
892- static int kernel_get_device (struct wgdevice * * device , const char * interface )
892+ static int kernel_get_device (struct wgdevice * * device , const char * iface )
893893{
894894 int ret = 0 ;
895895 struct nlmsghdr * nlh ;
@@ -908,7 +908,7 @@ static int kernel_get_device(struct wgdevice **device, const char *interface)
908908 }
909909
910910 nlh = mnlg_msg_prepare (nlg , WG_CMD_GET_DEVICE , NLM_F_REQUEST | NLM_F_ACK | NLM_F_DUMP );
911- mnl_attr_put_strz (nlh , WGDEVICE_A_IFNAME , interface );
911+ mnl_attr_put_strz (nlh , WGDEVICE_A_IFNAME , iface );
912912 if (mnlg_socket_send (nlg , nlh ) < 0 ) {
913913 ret = - errno ;
914914 goto out ;
@@ -963,14 +963,14 @@ char *ipc_list_devices(void)
963963 return buffer .buffer ;
964964}
965965
966- int ipc_get_device (struct wgdevice * * dev , const char * interface )
966+ int ipc_get_device (struct wgdevice * * dev , const char * iface )
967967{
968968#ifdef __linux__
969- if (userspace_has_wireguard_interface (interface ))
970- return userspace_get_device (dev , interface );
971- return kernel_get_device (dev , interface );
969+ if (userspace_has_wireguard_interface (iface ))
970+ return userspace_get_device (dev , iface );
971+ return kernel_get_device (dev , iface );
972972#else
973- return userspace_get_device (dev , interface );
973+ return userspace_get_device (dev , iface );
974974#endif
975975}
976976
0 commit comments