Page MenuHomeFreeBSD

[usr.sbin/rtadvd] optimize and secure interface lookup
ClosedPublic

Authored by maryse.levavasseur_stormshield.eu on Jun 27 2016, 8:47 AM.

Details

Summary

In rtadvd, interface lookup calls if_indextoname() many times in a loop,
(it takes a long time on systems with many interfaces)
without reason and without checking its return value.

This is fixed by this patch.

Test Plan

Our automated tests show no regression.
This patch is already included in Stormshield Network products.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

maryse.levavasseur_stormshield.eu retitled this revision from to [usr.sbin/rtadvd] optimize and secure interface lookup.
maryse.levavasseur_stormshield.eu edited the test plan for this revision. (Show Details)

Please upload diffs with full context (-U99999).

cem edited edge metadata.
cem added inline comments.
usr.sbin/rtadvd/if.c
497 ↗(On Diff #17963)

This check was completely bogus, ugh. ifi_ifname is an array.

This revision is now accepted and ready to land.Jun 29 2016, 4:24 AM
This revision was automatically updated to reflect the committed changes.