aboutsummaryrefslogtreecommitdiff
path: root/networking/tunctl.c
diff options
context:
space:
mode:
Diffstat (limited to 'networking/tunctl.c')
-rw-r--r--networking/tunctl.c20
1 files changed, 13 insertions, 7 deletions
diff --git a/networking/tunctl.c b/networking/tunctl.c
index 0a26ff7fb..f2dc645a1 100644
--- a/networking/tunctl.c
+++ b/networking/tunctl.c
@@ -24,7 +24,7 @@
24//config: Allow to specify owner and group of newly created interface. 24//config: Allow to specify owner and group of newly created interface.
25//config: 340 bytes of pure bloat. Say no here. 25//config: 340 bytes of pure bloat. Say no here.
26 26
27//applet:IF_TUNCTL(APPLET(tunctl, BB_DIR_SBIN, BB_SUID_DROP)) 27//applet:IF_TUNCTL(APPLET_NOEXEC(tunctl, tunctl, BB_DIR_SBIN, BB_SUID_DROP, tunctl))
28 28
29//kbuild:lib-$(CONFIG_TUNCTL) += tunctl.o 29//kbuild:lib-$(CONFIG_TUNCTL) += tunctl.o
30 30
@@ -83,10 +83,13 @@ int tunctl_main(int argc UNUSED_PARAM, char **argv)
83#endif 83#endif
84 }; 84 };
85 85
86 opt_complementary = "=0:t--d:d--t"; // no arguments; t ^ d 86 opts = getopt32(argv, "^"
87 opts = getopt32(argv, "f:t:d:" IF_FEATURE_TUNCTL_UG("u:g:b"), 87 "f:t:d:" IF_FEATURE_TUNCTL_UG("u:g:b")
88 "\0"
89 "=0:t--d:d--t", // no arguments; t ^ d
88 &opt_device, &opt_name, &opt_name 90 &opt_device, &opt_name, &opt_name
89 IF_FEATURE_TUNCTL_UG(, &opt_user, &opt_group)); 91 IF_FEATURE_TUNCTL_UG(, &opt_user, &opt_group)
92 );
90 93
91 // select device 94 // select device
92 memset(&ifr, 0, sizeof(ifr)); 95 memset(&ifr, 0, sizeof(ifr));
@@ -153,9 +156,12 @@ int tunctl_main(int argc UNUSED_PARAM, char **argv)
153 OPT_d = 1 << 2, // delete named interface 156 OPT_d = 1 << 2, // delete named interface
154 }; 157 };
155 158
156 opt_complementary = "=0:t--d:d--t"; // no arguments; t ^ d 159 opts = getopt32(argv, "^"
157 opts = getopt32(argv, "f:t:d:u:g:b", // u, g, b accepted and ignored 160 "f:t:d:u:g:b" // u, g, b accepted and ignored
158 &opt_device, &opt_name, &opt_name, NULL, NULL); 161 "\0"
162 "=0:t--d:d--t", // no arguments; t ^ d
163 &opt_device, &opt_name, &opt_name, NULL, NULL
164 );
159 165
160 // set interface name 166 // set interface name
161 memset(&ifr, 0, sizeof(ifr)); 167 memset(&ifr, 0, sizeof(ifr));