cvs commit: src/sys/netinet in.h ip_output.c ip_var.h

Maxim Konovalov maxim at macomnet.ru
Tue Jul 4 07:50:52 UTC 2006


kOn Tue, 4 Jul 2006, 02:36-0400, Scott Ullrich wrote:

> On 7/4/06, Maxim Konovalov <maxim at macomnet.ru> wrote:
> > How to repeat?  Btw allr, lockedvnods etc are not needed there.  "bt
> > full" is.
>
> # ifconfig pfsync0
> pfsync0: flags=0<> mtu 2020
>        syncpeer: 224.0.0.240 maxupd: 128
> # ifconfig pfsync0 syncdev lo0
>
0>
> Fatal trap 12: page fault while in kernel mode
[...]

That's enough, thanks!  It seems the same patch for if_pfsync.c solves
the problem.  The whole patch is:

Index: netinet/ip_carp.c
===================================================================
RCS file: /home/ncvs/src/sys/netinet/ip_carp.c,v
retrieving revision 1.40
diff -u -p -r1.40 ip_carp.c
--- netinet/ip_carp.c	2 Jun 2006 19:59:33 -0000	1.40
+++ netinet/ip_carp.c	4 Jul 2006 07:05:26 -0000
@@ -375,6 +375,10 @@ carp_clone_create(struct if_clone *ifc,
 #ifdef INET6
 	sc->sc_im6o.im6o_multicast_hlim = CARP_DFLTTL;
 #endif
+	sc->sc_imo.imo_membership = (struct in_multi **)malloc(
+	    (sizeof(struct in_multi *) * IP_MIN_MEMBERSHIPS), M_CARP,
+	    M_WAITOK);
+	sc->sc_imo.imo_max_memberships = IP_MIN_MEMBERSHIPS;

 	callout_init(&sc->sc_ad_tmo, NET_CALLOUT_MPSAFE);
 	callout_init(&sc->sc_md_tmo, NET_CALLOUT_MPSAFE);
@@ -415,6 +419,7 @@ carp_clone_destroy(struct ifnet *ifp)
 	bpfdetach(ifp);
 	if_detach(ifp);
 	if_free_type(ifp, IFT_ETHER);
+	free(sc->sc_imo.imo_membership, M_CARP);
 	free(sc, M_CARP);
 }

Index: contrib/pf/net/if_pfsync.c
===================================================================
RCS file: /home/ncvs/src/sys/contrib/pf/net/if_pfsync.c,v
retrieving revision 1.28
diff -u -p -r1.28 if_pfsync.c
--- contrib/pf/net/if_pfsync.c	16 Jun 2006 10:25:06 -0000	1.28
+++ contrib/pf/net/if_pfsync.c	4 Jul 2006 07:46:29 -0000
@@ -200,6 +200,7 @@ pfsync_clone_destroy(struct ifnet *ifp)
         if_detach(ifp);
 	if_free(ifp);
         LIST_REMOVE(sc, sc_next);
+	free(sc->sc_imo.imo_membership, M_PFSYNC);
         free(sc, M_PFSYNC);
 }

@@ -227,6 +228,10 @@ pfsync_clone_create(struct if_clone *ifc
 	sc->sc_sendaddr.s_addr = htonl(INADDR_PFSYNC_GROUP);
 	sc->sc_ureq_received = 0;
 	sc->sc_ureq_sent = 0;
+	sc->sc_imo.imo_membership =(struct in_multi **)malloc(
+	    (sizeof(struct in_multi *) * IP_MIN_MEMBERSHIPS), M_PFSYNC,
+	    M_WAITOK);
+	sc->sc_imo.imo_max_memberships = IP_MIN_MEMBERSHIPS;

 	ifp = SCP2IFP(sc);
 	if_initname(ifp, ifc->ifc_name, unit);
%%%

I never used carp(4) so I can't check it works.

It would be nice to commit a diff below too:

Index: contrib/pf/man/pfsync.4
===================================================================
RCS file: /home/ncvs/src/contrib/pf/man/pfsync.4,v
retrieving revision 1.9
diff -u -p -r1.9 pfsync.4
--- contrib/pf/man/pfsync.4	6 Jun 2006 12:35:53 -0000	1.9
+++ contrib/pf/man/pfsync.4	4 Jul 2006 07:49:02 -0000
@@ -33,6 +33,7 @@
 .Nm pfsync
 .Nd packet filter state table logging interface
 .Sh SYNOPSIS
+.Cd "device pf"
 .Cd "device pfsync"
 .Sh DESCRIPTION
 The
%%%

-- 
Maxim Konovalov


More information about the cvs-src mailing list