summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorclaudio <claudio@openbsd.org>2009-01-30 20:46:33 +0000
committerclaudio <claudio@openbsd.org>2009-01-30 20:46:33 +0000
commit00447b7038644521ba802d793e24cc191a15945a (patch)
tree84d0e8a51ac305c65767c72b78c678bb13e2ce41
parentDo not break header for messages received via smtp. (diff)
downloadwireguard-openbsd-00447b7038644521ba802d793e24cc191a15945a.tar.xz
wireguard-openbsd-00447b7038644521ba802d793e24cc191a15945a.zip
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@
-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;