summaryrefslogtreecommitdiff
path: root/sys/netinet/ip_output.c
diff options
context:
space:
mode:
authorClaudio Jeker <claudio@cvs.openbsd.org>2009-01-30 20:46:34 +0000
committerClaudio Jeker <claudio@cvs.openbsd.org>2009-01-30 20:46:34 +0000
commit427bc222dda750a3074d9a85225832757ca3c392 (patch)
treed653f484b9cc3a87bc810b44792337af45289d1c /sys/netinet/ip_output.c
parent00e5e338fb1ee4224b1f29aac8ed3eeaa5e4d63d (diff)
When don't-fragment packets need to get fragemnted some code tries to
update the route specific MTU from the interface (because it could have changed in between). This only makes sense if we actually have a valid route but e.g. multicast traffic does no route lookup and so there is no route at all and we don't need to update anything. Hit by dlg@'s pfsync rewrite which already found 3 other bugs in the network stack and slowly makes us wonder how it worked in the first place. OK mcbride@ dlg@
Diffstat (limited to 'sys/netinet/ip_output.c')
-rw-r--r--sys/netinet/ip_output.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/netinet/ip_output.c b/sys/netinet/ip_output.c
index cfe8ecc81d9..ab65a4b0eb4 100644
--- a/sys/netinet/ip_output.c
+++ b/sys/netinet/ip_output.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ip_output.c,v 1.192 2009/01/29 12:33:15 naddy Exp $ */
+/* $OpenBSD: ip_output.c,v 1.193 2009/01/30 20:46:33 claudio Exp $ */
/* $NetBSD: ip_output.c,v 1.28 1996/02/13 23:43:07 christos Exp $ */
/*
@@ -753,7 +753,8 @@ sendit:
* them, there is no way for one to update all its
* routes when the MTU is changed.
*/
- if ((ro->ro_rt->rt_flags & (RTF_UP | RTF_HOST)) &&
+ if (ro->ro_rt != NULL &&
+ (ro->ro_rt->rt_flags & (RTF_UP | RTF_HOST)) &&
!(ro->ro_rt->rt_rmx.rmx_locks & RTV_MTU) &&
(ro->ro_rt->rt_rmx.rmx_mtu > ifp->if_mtu)) {
ro->ro_rt->rt_rmx.rmx_mtu = ifp->if_mtu;