{"action":"created","issue":{"url":"https://api.github.com/repos/troglobit/pimd/issues/57","labels_url":"https://api.github.com/repos/troglobit/pimd/issues/57/labels{/name}","comments_url":"https://api.github.com/repos/troglobit/pimd/issues/57/comments","events_url":"https://api.github.com/repos/troglobit/pimd/issues/57/events","html_url":"https://github.com/troglobit/pimd/issues/57","id":106868837,"number":57,"title":"pimd 2.3.0 didn't update mcast routing table on FreeBSD ?","user":{"login":"ocochard","id":1012256,"avatar_url":"https://avatars.githubusercontent.com/u/1012256?v=3","gravatar_id":"","url":"https://api.github.com/users/ocochard","html_url":"https://github.com/ocochard","followers_url":"https://api.github.com/users/ocochard/followers","following_url":"https://api.github.com/users/ocochard/following{/other_user}","gists_url":"https://api.github.com/users/ocochard/gists{/gist_id}","starred_url":"https://api.github.com/users/ocochard/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ocochard/subscriptions","organizations_url":"https://api.github.com/users/ocochard/orgs","repos_url":"https://api.github.com/users/ocochard/repos","events_url":"https://api.github.com/users/ocochard/events{/privacy}","received_events_url":"https://api.github.com/users/ocochard/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":15,"created_at":"2015-09-16T21:34:49Z","updated_at":"2015-12-30T20:03:11Z","closed_at":null,"body":"Here is my simple setup with 2 routers (R2 and R3) when I ask to use igmpv2:\r\n\r\nmcast server (em0) --- (em0) R2 (em1) ---- (em1) R3 (em2) ---- (em2) subscriber\r\n\r\n    [root@R2]~# pimd -v\r\n    pimd version 2.3.0\r\n\r\n    [root@R2]~# cat /usr/local/etc/pimd.conf\r\n    cand_rp 10.0.23.2 time 10 priority 1\r\n\r\n    [root@R3]~# cat /usr/local/etc/pimd.conf\r\n    cand_bootstrap_router 10.0.23.3 priority 1\r\n\r\n    [root@R3]~# pimd -dd\r\n    debug level 0x7 (dvmrp_prunes,dvmrp_routes,dvmrp_neighbors)\r\n    22:48:45.635 pimd version 2.3.0 starting ...\r\n    22:48:45.635 Getting vifs from kernel\r\n    22:48:45.636 Installing em1 (10.0.23.3 on subnet 10.0.23/24) as vif #0 - rate 0\r\n    22:48:45.636 Installing em2 (10.0.34.3 on subnet 10.0.34/24) as vif #1 - rate 0\r\n    22:48:45.636 Getting vifs from /usr/local/etcpimd.conf\r\n    22:48:45.639 Interface em1 comes up; vif #0 now in service\r\n    22:48:45.643 Interface em2 comes up; vif #1 now in service\r\n    22:48:45.647 Interface register_vif0 comes up; vif #2 now in service\r\n\r\n\r\n    [root@R2]~# pimd -dd\r\n    debug level 0x7 (dvmrp_prunes,dvmrp_routes,dvmrp_neighbors)\r\n    22:48:47.392 pimd version 2.3.0 starting ...\r\n    22:48:47.392 Getting vifs from kernel\r\n    22:48:47.392 Installing em0 (10.0.12.2 on subnet 10.0.12/24) as vif #0 - rate 0\r\n    22:48:47.393 Installing em1 (10.0.23.2 on subnet 10.0.23/24) as vif #1 - rate 0\r\n    22:48:47.393 Getting vifs from /usr/local/etcpimd.conf\r\n    22:48:47.394 Interface em0 comes up; vif #0 now in service\r\n    22:48:47.398 Interface em1 comes up; vif #1 now in service\r\n    22:48:47.402 Interface register_vif0 comes up; vif #2 now in service\r\n\r\nThen I ask the subscriber to subscribe to an mcast group:\r\n\r\n    [root@R4]~# mtest\r\n    multicast membership test program; enter ? for list of commands\r\n    j 239.1.1.1 em2 10.0.12.1\r\n    ok\r\n\r\nR3 correctly notice this new membership:\r\n\r\n    22:50:14.242 Switch shortest path (SPT): src 10.0.12.1, group 239.1.1.1\r\n    22:50:15.643 Switch shortest path (SPT): src 10.0.12.1, group 239.1.1.1\r\n    22:50:20.843 Switch shortest path (SPT): src 10.0.12.1, group 239.1.1.1\r\n\r\nBut its multicast routes of PIM router R3 are still empty:\r\n\r\n    [root@R3]~# pimd -r\r\n    Virtual Interface Table ======================================================\r\n    Vif  Local Address    Subnet              Thresh  Flags      Neighbors\r\n    ---  ---------------  ------------------  ------  ---------  -----------------\r\n      0  10.0.23.3        10.0.23/24               1  DR PIM     10.0.23.2\r\n      1  10.0.34.3        10.0.34/24               1  DR NO-NBR\r\n      2  10.0.23.3        register_vif0            1\r\n    \r\n     Vif  SSM Group        Sources\r\n    \r\n    Multicast Routing Table ======================================================\r\n    --------------------------------- (*,*,G) ------------------------------------\r\n    Number of Groups: 0\r\n    Number of Cache MIRRORs: 0\r\n    ------------------------------------------------------------------------------\r\n\r\n=> Should't it display this new mcast group ?\r\n"},"comment":{"url":"https://api.github.com/repos/troglobit/pimd/issues/comments/168065224","html_url":"https://github.com/troglobit/pimd/issues/57#issuecomment-168065224","issue_url":"https://api.github.com/repos/troglobit/pimd/issues/57","id":168065224,"user":{"login":"troglobit","id":183517,"avatar_url":"https://avatars.githubusercontent.com/u/183517?v=3","gravatar_id":"","url":"https://api.github.com/users/troglobit","html_url":"https://github.com/troglobit","followers_url":"https://api.github.com/users/troglobit/followers","following_url":"https://api.github.com/users/troglobit/following{/other_user}","gists_url":"https://api.github.com/users/troglobit/gists{/gist_id}","starred_url":"https://api.github.com/users/troglobit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/troglobit/subscriptions","organizations_url":"https://api.github.com/users/troglobit/orgs","repos_url":"https://api.github.com/users/troglobit/repos","events_url":"https://api.github.com/users/troglobit/events{/privacy}","received_events_url":"https://api.github.com/users/troglobit/received_events","type":"User","site_admin":false},"created_at":"2015-12-30T20:03:11Z","updated_at":"2015-12-30T20:03:11Z","body":"@ocochard OK, this took the better part of the whole day, but I *may* have found something now.  If I take pimd v2.3.1 and change https://github.com/troglobit/pimd/blob/master/pim_proto.c#L952\r\n\r\n    #ifdef HAVE_IP_HDRINCL_BSD_ORDER\r\n\r\nto\r\n\r\n    #if 0 //#ifdef HAVE_IP_HDRINCL_BSD_ORDER\r\n\r\nI can get a three-in-a-row FreeBSD 10.2 (64-bit) setup to actually route multicast.  It's definitely something with how the FreeBSD kernel does `ntohs()` for *some* sockets, but not all. I don't know yet if this is only FreeBSD or it applies to all BSD's?  OK, maybe not OpenBSD, they seem to have run pure RAW sockets like Linux for quite some time now, but maybe a NetBSD issue as well."}}