From nobody@FreeBSD.org  Fri Apr 25 08:48:36 2014
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
	(using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by hub.freebsd.org (Postfix) with ESMTPS id 8A054EFC
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 25 Apr 2014 08:48:36 +0000 (UTC)
Received: from cgiserv.freebsd.org (cgiserv.freebsd.org [IPv6:2001:1900:2254:206a::50:4])
	(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
	(Client did not present a certificate)
	by mx1.freebsd.org (Postfix) with ESMTPS id 5C1841329
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 25 Apr 2014 08:48:36 +0000 (UTC)
Received: from cgiserv.freebsd.org ([127.0.1.6])
	by cgiserv.freebsd.org (8.14.8/8.14.8) with ESMTP id s3P8mZuq061420
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 25 Apr 2014 08:48:35 GMT
	(envelope-from nobody@cgiserv.freebsd.org)
Received: (from nobody@localhost)
	by cgiserv.freebsd.org (8.14.8/8.14.8/Submit) id s3P8mZ5f061416;
	Fri, 25 Apr 2014 08:48:35 GMT
	(envelope-from nobody)
Message-Id: <201404250848.s3P8mZ5f061416@cgiserv.freebsd.org>
Date: Fri, 25 Apr 2014 08:48:35 GMT
From: Perezhilin Yuri <yuri@rivera.ru>
To: freebsd-gnats-submit@FreeBSD.org
Subject: net/igmpproxy: kernel structure ip bugfix
X-Send-Pr-Version: www-3.1
X-GNATS-Notify: melifaro@ipfw.ru

>Number:         188986
>Category:       ports
>Synopsis:       net/igmpproxy: kernel structure ip bugfix
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          feedback
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Apr 25 08:50:01 UTC 2014
>Closed-Date:    
>Last-Modified:  Fri Apr 25 09:00:00 UTC 2014
>Originator:     Perezhilin Yuri
>Release:        10.0-RELEASE
>Organization:
dnlab.ru
>Environment:
FreeBSD gw.ps-ax.ru 10.0-RELEASE FreeBSD 10.0-RELEASE #0 r260789: Thu Jan 16 22:34:59 UTC 2014     root@snap.freebsd.org:/usr/obj/usr/src/sys/GENERIC  amd64
>Description:
In FreeBSD 9.0 was been a lot of changes in struct ip {...}. 
In version 900044 field ip->ip_len has been changed to carry all length of packet (previosly it was be length without header's length), and all program, which use ip->ip_len, must be corrected. Unfortunately, igmpproxy doesn't update till 2009 year and don't work on FreeBSD 9/10. 
If you try to use igmpproxy now, /var/log/message you can see :
Apr 25 01:13:57 gw igmpproxy[68438]: received packet from 192.168.199.1 shorter (40 bytes) than hdr+data length (24+10216)
Apr 25 01:13:58 gw igmpproxy[68438]: received packet from 192.168.199.10 shorter (32 bytes) than hdr+data length (24+8168)
Apr 25 01:13:59 gw igmpproxy[68438]: received packet from 192.168.199.1 shorter (40 bytes) than hdr+data length (24+10216)
Apr 25 01:14:00 gw igmpproxy[68438]: received packet from 192.168.199.206 shorter (28 bytes) than hdr+data length (20+7148)
 

>How-To-Repeat:
Install port igmpproxy, and try to use it.
>Fix:
# This is a shell archive.  Save it in a file, remove anything before
# this line, and then unpack it by entering "sh file".  Note, it may
# create directories; files and directories will be owned by you and
# have default permissions.
#
# This archive contains:
#
#<----->patch-src_os-freebsd.h
#
echo x - patch-src_os-freebsd.h
sed 's/^X//' >patch-src_os-freebsd.h << '6c070e7d133b346b84f3533633640131'
X--- src/os-freebsd.h.orig<---->2009-10-05 22:07:06.000000000 +0400
X+++ src/os-freebsd.h<->2014-04-25 01:58:41.592218315 +0400
X@@ -14,9 +14,12 @@
X.
X static inline u_short ip_data_len(const struct ip *ip)
X {
X-<---->return ip->ip_len;
X+#if __FreeBSD_version >= 900044
X+<---->return ip->ip_len - (ip->ip_hl << 2);
X+#else
X+ <--->return ip->ip_len;
X+#endif
X }
X-
X static inline void ip_set_len(struct ip *ip, u_short len)
X {
X <---->ip->ip_len = len;
6c070e7d133b346b84f3533633640131
exit

>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->feedback 
State-Changed-By: edwin 
State-Changed-When: Fri Apr 25 08:50:09 UTC 2014 
State-Changed-Why:  
Awaiting maintainers feedback (via the GNATS Auto Assign Tool) 

http://www.freebsd.org/cgi/query-pr.cgi?pr=188986 

From: Edwin Groothuis <edwin@FreeBSD.org>
To: melifaro@ipfw.ru
Cc: bug-followup@FreeBSD.org
Subject: Re: ports/188986: net/igmpproxy: kernel structure ip bugfix
Date: Fri, 25 Apr 2014 08:50:08 UT

 Maintainer of net/igmpproxy,
 
 Please note that PR ports/188986 has just been submitted.
 
 If it contains a patch for an upgrade, an enhancement or a bug fix
 you agree on, reply to this email stating that you approve the patch
 and a committer will take care of it.
 
 The full text of the PR can be found at:
     http://www.freebsd.org/cgi/query-pr.cgi?pr=ports/188986
 
 -- 
 Edwin Groothuis via the GNATS Auto Assign Tool
 edwin@FreeBSD.org
>Unformatted:
