Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 28 Nov 1997 10:39:56 -0500 (EST)
From:      Brian Clapper <bmc@WillsCreek.COM>
To:        questions@freebsd.org
Subject:   Re: Natd ???
Message-ID:  <199711281539.KAA11894@current.willscreek.com>
In-Reply-To: <37379100@toto.iv>

next in thread | previous in thread | raw e-mail | index | archive | help
Frederico Pereira da Costa wrote:

> I am using Free BSD 2.2.2 and i have added
> the daemon natd, and now i am receiving this
> error randomly ...
>
> autor kernel log messages:
> > enabled, logging disabled
> > WARNING: / was not properly dismounted.
> >
> > Fatal trap 12: page fault while in kernel mode
> > fault virtual address = 0xf0582000
> > fault code            = supervisor read, page not present
> > instruction pointer   = 0x8:0xf014452e
> > stack pointer         = 0x10:0xefbffde4
> > frame pointer         = 0x10:0xefbffde8
> > code segment          = base 0x0, limit 0xfffff, type 0x1b
> >                       = DPL 0, pres 1, def32 1, gran 1
> > processor eflags      = interrupt enabled, resume, IOPL = 0
> > current process               = 166 (natd)
> > interrupt mask                = net tty
> > panic: page fault
> >
> > syncing disks... Copyright (c) 1992-1997 FreeBSD Inc.
>
> Anyone can help me, because this happen on 10 a 20 min interval,
> and this is our server connect to internet
>
> Thanks in advance
>
> Frederico

This is a known problem with natd on 2.2.2-RELEASE; if you search the
archive for this mailing list (go to http://www.freebsd.org and follow the
`search' link), you'll find it's come up before.  I solved it here by
adapting a kernel source patch that was posted to the list.  I've enclosed
the patch I used, as a shar (shell archive) file.  Here's the README from
that file:

        This file patches the FreeBSD 2.2.2-RELEASE version of
        `/usr/src/sys/net/ppp_tty.c' so it won't panic the system when used
        with natd(8).  According to traffic on the `freebsd-questions'
        mailing list, the problem was that pppfcs() was being called
        sometimes with a negative `m->m_len'.  The patch simply ensures
        that a negative `m->m_len' value is reset to 0 before calls to
        pppfcs().

        According to a message posted by Brian Somers (brian@freebsd.org,
        `http://freebsd.org/~brian/') on the `freebsd-questions' mailing
        list, the real underlying problem has been corrected for newer
        versions of FreeBSD.

Thus, if you upgrade to 2.2.5-RELEASE, your problem should go away and you
should need this patch.  If, however, upgrading is not practical for you at
this time, you can try the enclosed kernel patch.  To unpack it, save the
`shar' portion to a file and run it through /bin/sh.  Or, if you have the
`sharutils' port/package installed, just run the entire mail message
through `gunshar'.

To install the patch, run the `pppd+natd-panic-patch' through patch(1),
while in the `/usr/src/sys/net/' directory.  Then rebuild your kernel,
install the new kernel, and reboot.  Make sure the diffs were applied
properly *before* you rebuild your kernel.

I've been using a 2.2.2-RELEASE kernel with the enclosed patch for more
than two months now, and the problem has not recurred.  Of course, your
mileage may vary; as always, when patching the kernel, be aware that you
may actually make your problems worse.
-----
Brian Clapper, bmc@WillsCreek.COM, http://WWW.WillsCreek.COM/
Government expands to absorb all revenue and then some.

#! /bin/sh
# This is a shell archive.  Remove anything before this line, then unpack
# it by saving it into a file and typing "sh file".  To overwrite existing
# files, type "sh file -c".  You can also feed this as standard input via
# unshar, or by typing "sh <file", e.g..  If this archive is complete, you
# will see the following message at the end:
#               "End of shell archive."
# Contents:  README pppd+natd-panic-patch
# Wrapped by bmc@current.willscreek.com on Fri Sep  5 09:28:17 1997
PATH=/bin:/usr/bin:/usr/ucb ; export PATH
if test -f 'README' -a "${1}" != "-c" ; then
  echo shar: Will not clobber existing file \"'README'\"
else
echo shar: Extracting \"'README'\" \(660 characters\)
sed "s/^X//" >'README' <<'END_OF_FILE'
XFile: pppd+natd-panic-patch
X
X       This file patches the FreeBSD 2.2.2-RELEASE version of
X       `/usr/src/sys/net/ppp_tty.c' so it won't panic the system when used
X       with natd(8).  According to traffic on the `freebsd-questions'
X       mailing list, the problem was that pppfcs() was being called
X       sometimes with a negative `m->m_len'.  The patch simply ensures
X       that a negative `m->m_len' value is reset to 0 before calls to
X       pppfcs().
X
X       According to a message posted by Brian Somers (brian@freebsd.org,
X       `http://freebsd.org/~brian/') on the `freebsd-questions' mailing
X       list, the real underlying problem has been corrected for newer
X       versions of FreeBSD.
X
Xbmc@WillsCreek.COM
END_OF_FILE
if test 660 -ne `wc -c <'README'`; then
    echo shar: \"'README'\" unpacked with wrong size!
fi
# end of 'README'
fi
if test -f 'pppd+natd-panic-patch' -a "${1}" != "-c" ; then
  echo shar: Will not clobber existing file \"'pppd+natd-panic-patch'\"
else
echo shar: Extracting \"'pppd+natd-panic-patch'\" \(610 characters\)
sed "s/^X//" >'pppd+natd-panic-patch' <<'END_OF_FILE'
X*** ppp_tty.c.orig     Fri Sep  5 09:10:37 1997
X--- ppp_tty.c  Fri Sep  5 09:18:13 1997
X***************
X*** 671,676 ****
X--- 671,678 ----
X           }
X
X           /* Calculate the FCS for the first mbuf's worth. */
X+             if (m->m_len < 0)
X+                 m->m_len = 0;
X           sc->sc_outfcs = pppfcs(PPP_INITFCS, mtod(m, u_char *), m->m_len);
X       }
X
X***************
X*** 775,780 ****
X--- 777,784 ----
X               sc->sc_if.if_obytes = sc->sc_bytessent;
X               break;
X           }
X+             if (m->m_len < 0)
X+                 m->m_len = 0;
X           sc->sc_outfcs = pppfcs(sc->sc_outfcs, mtod(m, u_char *), m->m_len);
X       }
X
END_OF_FILE
if test 610 -ne `wc -c <'pppd+natd-panic-patch'`; then
    echo shar: \"'pppd+natd-panic-patch'\" unpacked with wrong size!
fi
# end of 'pppd+natd-panic-patch'
fi
echo shar: End of shell archive.
exit 0



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199711281539.KAA11894>