mirror of
https://git.FreeBSD.org/src.git
synced 2025-01-17 15:27:36 +00:00
Fix off by one error introduced by the use of the ifnet_byindex()
macro. The commit log clearly states that the index given to the macro is one higher than previously used to index the array. This wasn't represented in the code and resulted in kernel page faults. Reported by: Andrew Atrens <atrens@nortelnetworks.com>
This commit is contained in:
parent
cfcb80526f
commit
b7a81e06aa
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=83436
@ -202,7 +202,7 @@ osf1_ioctl_i(p, uap, cmd, dir, len)
|
||||
* structure, as DU interface names are all different.
|
||||
*/
|
||||
for (ifn = 0; ifn < if_index; ifn++) {
|
||||
ifp = ifnet_byindex(ifn);
|
||||
ifp = ifnet_byindex(ifn + 1);
|
||||
/* Only look at ether interfaces, exclude alteon nics
|
||||
* because osf/1 doesn't know about most of them.
|
||||
*/
|
||||
|
@ -1385,7 +1385,7 @@ linux_ioctl_socket(struct thread *td, struct linux_ioctl_args *args)
|
||||
* structure, as Linux interface names are all different.
|
||||
*/
|
||||
for (ifn = 0; ifn < if_index; ifn++) {
|
||||
ifp = ifnet_byindex(ifn);
|
||||
ifp = ifnet_byindex(ifn + 1);
|
||||
if (ifp->if_type == IFT_ETHER) {
|
||||
ifa = TAILQ_FIRST(&ifp->if_addrhead);
|
||||
while (ifa) {
|
||||
|
Loading…
Reference in New Issue
Block a user