Calculate the offset of the interface name using FR_NAME rather than

calclulating it "by hand". This improves consistency with the rest of
the code and is in line with planned fixes and other work.

MFC after:	1 week
This commit is contained in:
Cy Schubert 2019-07-14 02:46:34 +00:00
parent 49a28fbdd2
commit d096fc9ccd
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=349980

View File

@ -980,7 +980,7 @@ ipf_state_putent(softc, softs, data)
fr->fr_ifas[i] = NULL;
continue;
}
name = fr->fr_names + fr->fr_ifnames[i];
name = FR_NAME(fr, fr_ifnames[i]);
fr->fr_ifas[i] = ipf_resolvenic(softc, name,
fr->fr_family);
}
@ -1794,7 +1794,7 @@ ipf_state_add(softc, fin, stsave, flags)
fr->fr_names[fr->fr_ifnames[out << 1] + 1] == '\0')) {
is->is_ifp[out << 1] = fr->fr_ifas[0];
strncpy(is->is_ifname[out << 1],
fr->fr_names + fr->fr_ifnames[0],
FR_NAME(fr, fr_ifnames[0]),
sizeof(fr->fr_ifnames[0]));
} else {
is->is_ifp[out << 1] = fin->fin_ifp;
@ -1805,21 +1805,21 @@ ipf_state_add(softc, fin, stsave, flags)
is->is_ifp[(out << 1) + 1] = fr->fr_ifas[1];
if (fr->fr_ifnames[1] != -1) {
strncpy(is->is_ifname[(out << 1) + 1],
fr->fr_names + fr->fr_ifnames[1],
FR_NAME(fr, fr_ifnames[1]),
sizeof(fr->fr_ifnames[1]));
}
is->is_ifp[(1 - out) << 1] = fr->fr_ifas[2];
if (fr->fr_ifnames[2] != -1) {
strncpy(is->is_ifname[((1 - out) << 1)],
fr->fr_names + fr->fr_ifnames[2],
FR_NAME(fr, fr_ifnames[2]),
sizeof(fr->fr_ifnames[2]));
}
is->is_ifp[((1 - out) << 1) + 1] = fr->fr_ifas[3];
if (fr->fr_ifnames[3] != -1) {
strncpy(is->is_ifname[((1 - out) << 1) + 1],
fr->fr_names + fr->fr_ifnames[3],
FR_NAME(fr, fr_ifnames[3]),
sizeof(fr->fr_ifnames[3]));
}
} else {