Date: Sun, 21 Jul 2019 00:47:06 +0000 (UTC) From: Cy Schubert <cy@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r350189 - in stable: 11/sys/contrib/ipfilter/netinet 12/sys/contrib/ipfilter/netinet Message-ID: <201907210047.x6L0l6FO046841@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: cy Date: Sun Jul 21 00:47:06 2019 New Revision: 350189 URL: https://svnweb.freebsd.org/changeset/base/350189 Log: MFC r349980: 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. Modified: stable/12/sys/contrib/ipfilter/netinet/ip_state.c Directory Properties: stable/12/ (props changed) Changes in other areas also in this revision: Modified: stable/11/sys/contrib/ipfilter/netinet/ip_state.c Directory Properties: stable/11/ (props changed) Modified: stable/12/sys/contrib/ipfilter/netinet/ip_state.c ============================================================================== --- stable/12/sys/contrib/ipfilter/netinet/ip_state.c Sun Jul 21 00:44:52 2019 (r350188) +++ stable/12/sys/contrib/ipfilter/netinet/ip_state.c Sun Jul 21 00:47:06 2019 (r350189) @@ -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 {
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201907210047.x6L0l6FO046841>