Synopsis: traceroute can do packet floods.
NetBSD versions: 1.3.3 and before, NetBSD-current until 19990217
Thanks to: Curt Sampson
Reported in NetBSD Security Advisory: SA1999-004
This patch fixes the traceroute flooding problem described in the
NetBSD-SA1999-004 security advisory. For it to apply, make sure
you have NetBSD 1.3.3 sources unpacked in /usr/src, then do:
% cd /usr/src/usr.sbin/traceroute
% patch <19990217-traceroute
% make
% su root
# make install
int
main(int argc, char **argv)
@@ -694,7 +696,7 @@
* Otherwise, use the first interface found.
* Warn if there are more than one.
*/
- setsin(from, al->addr);
+ setsin(from, al->addr && !find_local_ip(from, to));
if (n > 1 && device == NULL) {
Fprintf(stderr,
"%s: Warning: Multiple interfaces found; using %s @ %s\n",
@@ -871,6 +873,7 @@
struct timezone tz;
register int cc = 0;
int fromlen = sizeof(*fromp);
+ int retval;