Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
mojies opened this issue Apr 25, 2022 · 1 comment
Open

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

mojies opened this issue Apr 25, 2022 · 1 comment

Comments

@mojies
Copy link

mojies commented Apr 25, 2022

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 }
@landley
Copy link
Owner

landley commented Apr 25, 2022

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants