NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: kern/44508: [dM] ICMP_UNREACH_NEEDFRAG uses wrong mtu



The following reply was made to PR kern/44508; it has been noted by GNATS.

From: Mouse <mouse%Rodents-Montreal.ORG@localhost>
To: gnats-bugs%NetBSD.org@localhost
Cc: 
Subject: Re: kern/44508: [dM] ICMP_UNREACH_NEEDFRAG uses wrong mtu
Date: Fri, 18 Nov 2011 10:19:46 -0500 (EST)

 5.1 suffers from this as well.  Here's a diff that "works for me" on
 5.1, relative to ip_input.c,v 1.275.4.1, the one shipped with 5.1.
 
 /~\ The ASCII                            Mouse
 \ / Ribbon Campaign
  X  Against HTML               mouse%rodents-montreal.org@localhost
 / \ Email!          7D C8 61 52 5D E7 2D 39  4E F1 31 3E E8 B3 27 4B
 
 diff --git a/sys/netinet/ip_input.c b/sys/netinet/ip_input.c
 index 8cd094d..f1920cb 100644
 --- a/sys/netinet/ip_input.c
 +++ b/sys/netinet/ip_input.c
 @@ -1847,6 +1847,7 @@ ip_forward(struct mbuf *m, int srcrt)
                struct sockaddr         dst;
                struct sockaddr_in      dst4;
        } u;
 +      int rmtu;
  
        /*
         * We are now in the output path.
 @@ -1926,8 +1927,8 @@ ip_forward(struct mbuf *m, int srcrt)
        }
  
        error = ip_output(m, NULL, &ipforward_rt,
 -          (IP_FORWARDING | (ip_directedbcast ? IP_ALLOWBROADCAST : 0)),
 -          (struct ip_moptions *)NULL, (struct socket *)NULL);
 +          (IP_FORWARDING | IP_RETURNMTU | (ip_directedbcast ? 
IP_ALLOWBROADCAST : 0)),
 +          (struct ip_moptions *)NULL, (struct socket *)NULL, &rmtu);
  
        if (error)
                IP_STATINC(IP_STAT_CANTFORWARD);
 @@ -1974,6 +1975,8 @@ ip_forward(struct mbuf *m, int srcrt)
                if ((rt = rtcache_validate(&ipforward_rt)) != NULL)
                        destmtu = rt->rt_ifp->if_mtu;
  
 +              if (rmtu && (rmtu < destmtu)) destmtu = rmtu;
 +
  #if defined(IPSEC) || defined(FAST_IPSEC)
                {
                        /*
 


Home | Main Index | Thread Index | Old Index