Bug 202959 - Fix net/pimd build with clang 3.7.0
Summary: Fix net/pimd build with clang 3.7.0
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Olivier Cochard
URL:
Keywords:
Depends on:
Blocks: 201377
  Show dependency treegraph
 
Reported: 2015-09-07 21:40 UTC by Dimitry Andric
Modified: 2016-03-11 14:22 UTC (History)
4 users (show)

See Also:
bugzilla: maintainer-feedback? (olivier)


Attachments
Fix left-shifting of negative value in pimd.h (1.00 KB, patch)
2015-09-07 21:40 UTC, Dimitry Andric
no flags Details | Diff
Patch for v2.3.0 (7.63 KB, patch)
2015-09-07 23:19 UTC, Hiroki Sato
no flags Details | Diff
net/pimd update to 2.3.1 (7.63 KB, patch)
2015-12-11 09:59 UTC, olivier
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dimitry Andric freebsd_committer freebsd_triage 2015-09-07 21:40:18 UTC
Created attachment 160824 [details]
Fix left-shifting of negative value in pimd.h

During the exp-run in bug 201377, it was found that net/pimd gives errors with a recent clang 3.7.0 snapshot:

http://package18.nyi.freebsd.org/data/headi386PR201377-default/2015-08-20_15h42m20s/logs/errors/pimd-2.2.0.log

This is because pimd.h attempts to left-shift a negative value, which is undefined.  It is easy to fix, as in the attached patch.
Comment 1 olivier 2015-09-07 23:11:40 UTC
Thanks,

your patch was directly push to pimd code:

https://github.com/troglobit/pimd/commit/7475ccb3719e5a0fb060791493be672e26a12c86

I've started to update this port, but I meet a regression problem with the latest release.
Comment 2 Hiroki Sato freebsd_committer freebsd_triage 2015-09-07 23:19:56 UTC
Created attachment 160827 [details]
Patch for v2.3.0

Hi, I have a patch (attached) to update to 2.3.0 (+ fixes of styles and rc.d script).  What kind of regression did you see in the latest version?
Comment 3 olivier 2015-09-16 21:28:00 UTC
(In reply to Hiroki Sato from comment #2)

My multicast virtual lab didn't works once I've upgraded pimd to 2.3.0.
My virtual lab detail:
http://bsdrp.net/documentation/examples/multicast_with_pim-sm

Once pimd started on the multicast router (R2 and R3), when R4 ask for joining a mcast group:

[root@R4]~# mtest
multicast membership test program; enter ? for list of commands
j 239.1.1.1 em2 10.0.12.1
ok

R3 correctly received the join request:
[root@R3]~# tcpdump -ni em2 -vv
tcpdump: listening on em2, link-type EN10MB (Ethernet), capture size 65535 
    10.0.34.4 > 224.0.0.22: igmp v3 report, 1 group record(s) [gaddr 239.1.1.1 to_in { 10.0.12.1 }]
22:41:02.438726 IP (tos 0xc0, ttl 1, id 741, offset 0, flags [DF], proto IGMP (2), length 44, options (RA))
    10.0.34.4 > 224.0.0.22: igmp v3 report, 1 group record(s) [gaddr 239.1.1.1 to_in { 10.0.12.1 }]

But it didn't update its mcast table anymore by showing a new mcast subscriber :-(

[root@R3]~# pimd -r
Virtual Interface Table ======================================================
Vif  Local Address    Subnet              Thresh  Flags      Neighbors
---  ---------------  ------------------  ------  ---------  -----------------
  0  10.0.23.3        10.0.23/24               1  DR PIM     10.0.23.2
  1  10.0.34.3        10.0.34/24               1  DR NO-NBR
  2  10.0.23.3        register_vif0            1

 Vif  SSM Group        Sources

Multicast Routing Table ======================================================
--------------------------------- (*,*,G) ------------------------------------
Number of Groups: 0
Number of Cache MIRRORs: 0
------------------------------------------------------------------------------



Because iperf is igmpv2 only, I've tried with mcastread, but same behavior:


[root@R4]~# mcastread -v4 -s 10.0.12.1 em2 239.1.1.1 9090
mcastread: trying 239.1.1.1
mcastread: using (S,G)=(10.0.12.1,239.1.1.1)
Comment 4 Hiroki Sato freebsd_committer freebsd_triage 2015-09-17 01:21:13 UTC
(In reply to olivier from comment #3)

Was there no warning in the router's syslog message?  I guess MC join messages were rejected for some reason (probably due to a bug), and it was recorded in the log file.
Comment 5 olivier 2015-12-11 09:59:01 UTC
Created attachment 164111 [details]
net/pimd update to 2.3.1

Using the Hiroki patch (thanks!), I've updated the port to 2.3.1 (tested with poudriere on 9.1-i386 and head-amd64)
But I still meet the same problem as with 2.3.0: My multicast routers didn't route multicast anymore (with 2.3.0 and 2.3.1).
And still nothing in the log file.
Comment 6 commit-hook freebsd_committer freebsd_triage 2016-03-11 14:07:41 UTC
A commit references this bug:

Author: olivier
Date: Fri Mar 11 14:06:40 UTC 2016
New revision: 410830
URL: https://svnweb.freebsd.org/changeset/ports/410830

Log:
  - Update to 2.3.2
  - Fix build on i386

  PR:		202959
  Submitted by:	hrs
  Approved by:	jadawin
  Differential Revision:	https://reviews.freebsd.org/D5608

Changes:
  head/net/pimd/Makefile
  head/net/pimd/distinfo
  head/net/pimd/files/pimd.in
  head/net/pimd/pkg-plist
Comment 7 Olivier Cochard freebsd_committer freebsd_triage 2016-03-11 14:22:54 UTC
Latest version (2.3.2) that fix i386 build and was successfully tested on my multicast lab was committed.