Author: glebius
Date: Wed Mar 21 07:07:43 2012
New Revision: 233261
URL: http://svn.freebsd.org/changeset/base/233261

Log:
  Merge 227308 from head/:
    In icmp6_redirect_input:
  
    - Assert that we got a valid mbuf with rcvif pointer. [1]
    - Use __func__ in logging.
  
    Submitted by: prabhakar lakhera <prabhakar.lakhera gmail.com> [1]
    Submitted by: Kristof Provost <kristof sigsegv.be> [1]

Modified:
  stable/9/sys/netinet6/icmp6.c
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/amd64/include/xen/   (props changed)
  stable/9/sys/boot/   (props changed)
  stable/9/sys/boot/i386/efi/   (props changed)
  stable/9/sys/boot/ia64/efi/   (props changed)
  stable/9/sys/boot/ia64/ski/   (props changed)
  stable/9/sys/boot/powerpc/boot1.chrp/   (props changed)
  stable/9/sys/boot/powerpc/ofw/   (props changed)
  stable/9/sys/cddl/contrib/opensolaris/   (props changed)
  stable/9/sys/conf/   (props changed)
  stable/9/sys/contrib/dev/acpica/   (props changed)
  stable/9/sys/contrib/octeon-sdk/   (props changed)
  stable/9/sys/contrib/pf/   (props changed)
  stable/9/sys/contrib/x86emu/   (props changed)
  stable/9/sys/fs/   (props changed)
  stable/9/sys/fs/ntfs/   (props changed)
  stable/9/sys/i386/conf/XENHVM   (props changed)

Modified: stable/9/sys/netinet6/icmp6.c
==============================================================================
--- stable/9/sys/netinet6/icmp6.c       Wed Mar 21 07:07:00 2012        
(r233260)
+++ stable/9/sys/netinet6/icmp6.c       Wed Mar 21 07:07:43 2012        
(r233261)
@@ -2361,14 +2361,11 @@ icmp6_redirect_input(struct mbuf *m, int
        union nd_opts ndopts;
        char ip6buf[INET6_ADDRSTRLEN];
 
-       if (!m)
-               return;
+       M_ASSERTPKTHDR(m);
+       KASSERT(m->m_pkthdr.rcvif != NULL, ("%s: no rcvif", __func__));
 
        ifp = m->m_pkthdr.rcvif;
 
-       if (!ifp)
-               return;
-
        /* XXX if we are router, we don't update route by icmp6 redirect */
        if (V_ip6_forwarding)
                goto freeit;
@@ -2475,9 +2472,8 @@ icmp6_redirect_input(struct mbuf *m, int
        icmp6len -= sizeof(*nd_rd);
        nd6_option_init(nd_rd + 1, icmp6len, &ndopts);
        if (nd6_options(&ndopts) < 0) {
-               nd6log((LOG_INFO, "icmp6_redirect_input: "
-                   "invalid ND option, rejected: %s\n",
-                   icmp6_redirect_diag(&src6, &reddst6, &redtgt6)));
+               nd6log((LOG_INFO, "%s: invalid ND option, rejected: %s\n",
+                   __func__, icmp6_redirect_diag(&src6, &reddst6, &redtgt6)));
                /* nd6_options have incremented stats */
                goto freeit;
        }
@@ -2488,10 +2484,9 @@ icmp6_redirect_input(struct mbuf *m, int
        }
 
        if (lladdr && ((ifp->if_addrlen + 2 + 7) & ~7) != lladdrlen) {
-               nd6log((LOG_INFO,
-                   "icmp6_redirect_input: lladdrlen mismatch for %s "
+               nd6log((LOG_INFO, "%s: lladdrlen mismatch for %s "
                    "(if %d, icmp6 packet %d): %s\n",
-                   ip6_sprintf(ip6buf, &redtgt6),
+                   __func__, ip6_sprintf(ip6buf, &redtgt6),
                    ifp->if_addrlen, lladdrlen - 2,
                    icmp6_redirect_diag(&src6, &reddst6, &redtgt6)));
                goto bad;
_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-stable-9
To unsubscribe, send any mail to "[email protected]"

Reply via email to