summaryrefslogtreecommitdiff
path: root/sys/netinet/if_ether.c
diff options
context:
space:
mode:
authorClaudio Jeker <claudio@cvs.openbsd.org>2008-12-24 08:26:28 +0000
committerClaudio Jeker <claudio@cvs.openbsd.org>2008-12-24 08:26:28 +0000
commit0fd34fb48e410be83e96034843733c077a95d7b1 (patch)
tree4a697db4180c7f303e9e5b232687d3db77815027 /sys/netinet/if_ether.c
parent83368a4f899f2994b4906d952a915764b9c6bd25 (diff)
Fix two mbuf leaks in arpresolve. The first one happens on IFF_NOARP
interfaces and is probably never hit. The other one happens when the number of packets on the arp hold queue is exceeded. If arpresolve() returns NULL the mbuf must be on the hold queue or freed. Fixes the mbuf leak seen by dlg@. Found with dlg@'s insane mbuf leak diff. OK dlg@
Diffstat (limited to 'sys/netinet/if_ether.c')
-rw-r--r--sys/netinet/if_ether.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/sys/netinet/if_ether.c b/sys/netinet/if_ether.c
index d089a8d3b17..695ecbbea4b 100644
--- a/sys/netinet/if_ether.c
+++ b/sys/netinet/if_ether.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_ether.c,v 1.78 2008/10/31 21:08:33 claudio Exp $ */
+/* $OpenBSD: if_ether.c,v 1.79 2008/12/24 08:26:27 claudio Exp $ */
/* $NetBSD: if_ether.c,v 1.31 1996/05/11 12:59:58 mycroft Exp $ */
/*
@@ -418,8 +418,10 @@ arpresolve(ac, rt, m, dst, desten)
bcopy(LLADDR(sdl), desten, sdl->sdl_alen);
return 1;
}
- if (((struct ifnet *)ac)->if_flags & IFF_NOARP)
+ if (((struct ifnet *)ac)->if_flags & IFF_NOARP) {
+ m_freem(m);
return 0;
+ }
/*
* There is an arptab entry, but no ethernet address
@@ -452,6 +454,7 @@ arpresolve(ac, rt, m, dst, desten)
}
la->la_hold_tail = NULL;
la->la_hold_count = 0;
+ m_freem(m);
}
/*