Bug 187978 - net/mrouted's IGMP code are broken.
Summary: net/mrouted's IGMP code are broken.
Status: Closed Overcome By Events
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Hiroki Sato
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-03-26 19:20 UTC by kensaku.masuda
Modified: 2018-01-16 06:03 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description kensaku.masuda 2014-03-26 19:20:00 UTC
  mrouted ports in net/mrouted look like no problem at compile time. But it can not sending and receiving IGMP message.
Because, it code was too old.

Fix: 

iphdrlen  = ip->ip_hl << 2;
-    ipdatalen = ntohs(ip->ip_len) - iphdrlen;
+    ipdatalen = ip->ip_len;
     if ((size_t)(iphdrlen + ipdatalen) != recvlen) {
        logit(LOG_WARNING, 0,
            "received packet from %s shorter (%u bytes) than hdr+data length (%u+%u)",
@@ -346,7 +346,7 @@
     ip                      = (struct ip *)send_buf;
     ip->ip_src.s_addr       = src;
     ip->ip_dst.s_addr       = dst;
-    ip->ip_len              = htons(len);
+    ip->ip_len              = len;
     if (IN_MULTICAST(ntohl(dst))) {
        ip->ip_ttl = curttl;
     } else {--NPYZtrBZ0KgIO6fzsw2EVacSJBXjyFfqe1aU8Sc9BzOxRu8P
Content-Type: text/plain; name="file.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename="file.diff"

--- igmp.c      2011-10-23 17:03:36.000000000 +0900
+++ igmp.c.orig 2014-03-24 21:14:48.897460682 +0900
@@ -196,7 +196,7 @@
     }
How-To-Repeat: execute it. You will see any waring.
Comment 1 Edwin Groothuis freebsd_committer freebsd_triage 2014-03-26 21:55:48 UTC
Responsible Changed
From-To: freebsd-ports-bugs->hrs

Over to maintainer (via the GNATS Auto Assign Tool)
Comment 2 berend 2014-11-05 05:55:46 UTC
Note for people finding this: apparently on FreeBSD 10 (or 10.1??) you should use /etc/rc.d/mrouted start, not the ports version. That one works (probably has this fix?).
Comment 3 berend 2014-11-05 06:04:24 UTC
Forget last comment, it seems /etc/rc.d/mrouted is some kind of irrelevant remnant.
Comment 4 berend 2014-11-05 18:47:58 UTC
With this patch I still see this:

warning - received packet from 192.168.x.x shorter (28 bytes) than hdr+data length (20+28)

See this on two tunX interfaces, but also on a physical interface, but not on two other physical interfaces somehow.
Comment 5 Walter Schwarzenfeld freebsd_triage 2018-01-10 21:46:06 UTC
FreeBSD 10 and 10.1 are gone. The code in igmp.c has changed. I think this is overcome by events.