On Tue, Jan 05, 2016 at 12:29:43PM +0100, Håkon Lerring wrote:
> Hello misc.
>
> I was investigating a problem with a firewall that goes AWOL every week. It
> happens only if i activate an ipv6 address on a carp interface. The carp log
> has this message:
>
> Jan 5 12:10:06 <hostname> /bsd: carp: packet size 48 too small
>
> I think i have narrowed down the leak to the handling of too small
> ipv6-packets:
>
> --- ip_carp.c.orig 2016-01-05 12:18:03.000000000 +0100
> +++ ip_carp.c 2016-01-05 12:18:30.000000000 +0100
> @@ -562,6 +562,7 @@
> if ((m = m_pullup(m, *offp + sizeof(*ch))) == NULL) {
> carpstats.carps_badlen++;
> CARP_LOG(LOG_INFO, sc, ("packet size %u too small", len));
> + m_freem(m);
> return (IPPROTO_DONE);
> }
> ch = (struct carp_header *)(mtod(m, caddr_t) + *offp);
>
>
> I have not yet tested this patch since this is a production system. Why the
> other machine is sending incomplete packets is another question i'm currently
> investigating.
Your patch effectively just calls m_freem(NULL);
And m_pullup already frees the mbuf on failure.
Can you describe the actual problem you're seeing with more words than "AWOL"?