toybox icon indicating copy to clipboard operation
toybox copied to clipboard

There is a bug in line 165 of toys/pending/brctl.c

Open mojies opened this issue 2 years ago • 1 comments

There is a bug in line 165 of toys/pending/brctl.c

I thinke the varable of ifindex should be index

157 void br_delif(char **argv)
158 {
159   int index;·····························
160   struct ifreq ifr;······················
161   unsigned long args[4] = {BRCTL_DEL_IF, 0, 0, 0};
162
163   if (!(index = if_nametoindex(argv[1]))) perror_exit("interface %s",argv[1]);
164 #ifdef SIOCBRDELIF
165   ifr.ifr_ifindex = ifindex;
166   xioctl(TT.sockfd, SIOCBRDELIF, &ifr);
167 #else
168   args[1] = index;·····
169   xstrncpy(ifr.ifr_name, argv[0], IFNAMSIZ);
170   ifr.ifr_data = (char *)args;··
171   xioctl(TT.sockfd, SIOCDEVPRIVATE, &ifr);
172 #endif
173 }

mojies avatar Apr 25 '22 07:04 mojies

Yeah, that looks wrong. The fact it's not breaking for me says the #includes are wrong and it's not pulling in the symbol. Hmmm...

Thanks for the heads up.

landley avatar Apr 25 '22 08:04 landley