diff options
author | Christopher Pascoe <pascoe@cvs.openbsd.org> | 2005-07-31 03:30:56 +0000 |
---|---|---|
committer | Christopher Pascoe <pascoe@cvs.openbsd.org> | 2005-07-31 03:30:56 +0000 |
commit | 572772cf7ccf3f3860c0121c89ee22e0001d0692 (patch) | |
tree | 610ab2d75d296c730135e6ff5a6fc7544b6f5bf0 /sys/net | |
parent | 2c25fdbabd0951de2d2c84e82326825b902ced70 (diff) |
Change the API for icmp_do_error so that it takes the mtu directly, rather
than a pointer to struct ifnet containing it.
Saves a 448 byte stack allocation in ip_forward which previously faked up
a struct ifnet just for this purpose.
idea ok deraadt millert
Diffstat (limited to 'sys/net')
-rw-r--r-- | sys/net/if_bridge.c | 4 | ||||
-rw-r--r-- | sys/net/pf.c | 6 |
2 files changed, 5 insertions, 5 deletions
diff --git a/sys/net/if_bridge.c b/sys/net/if_bridge.c index ebc4dd89084..7510ec5842c 100644 --- a/sys/net/if_bridge.c +++ b/sys/net/if_bridge.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_bridge.c,v 1.144 2005/06/16 11:10:47 markus Exp $ */ +/* $OpenBSD: if_bridge.c,v 1.145 2005/07/31 03:30:55 pascoe Exp $ */ /* * Copyright (c) 1999, 2000 Jason L. Wright (jason@thought.net) @@ -2604,7 +2604,7 @@ bridge_send_icmp_err(struct bridge_softc *sc, struct ifnet *ifp, m_freem(n); return; } - m = icmp_do_error(n, type, code, 0, ifp); + m = icmp_do_error(n, type, code, 0, ifp->if_mtu); if (m == NULL) { m_freem(n2); return; diff --git a/sys/net/pf.c b/sys/net/pf.c index 6d9e3583d21..c2f29bb30d5 100644 --- a/sys/net/pf.c +++ b/sys/net/pf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pf.c,v 1.496 2005/07/29 06:26:43 pascoe Exp $ */ +/* $OpenBSD: pf.c,v 1.497 2005/07/31 03:30:55 pascoe Exp $ */ /* * Copyright (c) 2001 Daniel Hartmeier @@ -1638,7 +1638,7 @@ pf_send_icmp(struct mbuf *m, u_int8_t type, u_int8_t code, sa_family_t af, switch (af) { #ifdef INET case AF_INET: - icmp_error(m0, type, code, 0, (void *)NULL); + icmp_error(m0, type, code, 0, 0); break; #endif /* INET */ #ifdef INET6 @@ -5415,7 +5415,7 @@ pf_route(struct mbuf **m, struct pf_rule *r, int dir, struct ifnet *oifp, ipstat.ips_cantfrag++; if (r->rt != PF_DUPTO) { icmp_error(m0, ICMP_UNREACH, ICMP_UNREACH_NEEDFRAG, 0, - ifp); + ifp->if_mtu); goto done; } else goto bad; |