-
-
Notifications
You must be signed in to change notification settings - Fork 65
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Problem building and running SMCRoute on FreeBSD #5
Comments
I don't have any FreeBSD installation to play around with at the moment, and the net/route.h issue However, did you try GNU Make when building, or is that BSD PMake? |
First an obvious question: is FreeBSD supported by smcroute? I thought it was, but I may have been mistaken. Anyway, this is BSD make. According to the man page, "This make implementation is based on Adam De Boor's pmake program which was written for Sprite at Berkeley.". It seems there are multiple issues with FreeBSD 10.
I followed the advise at https://www.gnu.org/software/autoconf/manual/autoconf-2.67/html_node/Present-But-Cannot-Be-Compiled.html and changed in configure.ac:
to:
This caused ./configure to recognise net/route.h. Warning: I am by no means a autotools-expert, please check and test before you make changes.
Changing from make to gmake (GNU make) resolved this, but gave another error:
I have not yet investigated the last issue any further. |
To respond to your question. Under the care of Debian SMCroute did support FreeBSD. But like any open source project it relies on the input of its contributors. As the maintainer of multiple multicast routing daemons for UNIX I'm aware of the problems FreeBSD has had with raw sockets, pimd for instance doesn't work at all on FreeBSD. But in FreeBSD 10 it's supposed to be fixed. Again, I haven't had the opportunity to check this myself yet. Patches are welcome, but you're likely flying on your own at the moment. I wish you the best of luck! |
Hi, I did the FreeBSD port some time ago, so I guess that I can contribute a bit to resolve your issue. To verify your issue I just logged in to a Debian porter box running FreeBSD 9.0 and Debian sid:
But configure still runs on that box without any of the issues mentioned above. I wonder what this will look like when Debian updates its FreeBSD kernel to FreeBSD 10... Regarding the suggested fix for your first mentioned issue this looks like a hack to fight a missing include in some of the FreeBSD headers. If this assessment is true I would rather like to see this fixed in the FreeBSD headers, especially as smcroute does build on FreeBSD 9... Regarding the second issue we need to adress the errors one by one. The first one was that it couldn't find a definition for MAXVIFS, which on my FreeBSD 9 system is located in the include file netinet/ip_mroute.h. At least the missing definition of MAXVIFS matches what your configure run did output earlier:
Are you really trying to build smcroute for use with IPv6 multicast only? If yes we probably need to add some more macro conditionals to the code to get it built on IPv6 only systems too... Best regards, |
OK, I've got a FreeBSD 10 installation up and running now. I needed it for troglobit/pimd#23 as well ... I see quite a bit of problems ... introduced by me, blindly focusing too much on Linux. Fixing. |
FreeBSD fixes - net/route.h needs sys/socket.h (struct sockaddr) - netinet/ip_mroute.h needs sys/types.h (u_long et consortes) Fixes part of smcroute issue #5 Signed-off-by: Joachim Nilsson <[email protected]>
…eeBSD - Refactor dep file generation using fancy new GCC feature - Remove ifneq's around -include, not needed now Fixes part of smcroute issue #5 Signed-off-by: Joachim Nilsson <[email protected]>
- Fix comment-within-comment Linux/*BSD --> Linux and *BSD - Fix 'struct vif' definition --> struct { .. } vif_list[] Fixes part of smcroute issue #5 Signed-off-by: Joachim Nilsson <[email protected]>
The System V calling convention for setpgrp() is not available on FreeBSD, replace with equivalent setpgid(0, 0). Also, fix missing return value in read_mroute6_socket(). Fixes part of smcroute issue #5 Signed-off-by: Joachim Nilsson <[email protected]>
@macfreek If at all possible, could you try the latest master? |
@troglobit Thanks a lot! I was able to compile it, but I am away from home this week, and can't actually check if the output is a usable program :). I'll do so next weekend. There are some minor issues with the Makefile, which may have to do with difference between GNU make and BSD make:
@bombadil It seems that API for raw sockets have been changed in FreeBSD 10, and will again change for FreeBSD 11: http://lists.freebsd.org/pipermail/freebsd-net/2014-January/037512.html. My first hunch was that this was causing my problems, but it seems unrelated (as far as I can tell from the commits). PS: It is annoying that the link on the scmroute github page named "Download ZIP" downloads an old version. I should learn to recognise the hashes from each other. :) |
@macfreek Great news, thank you so much for testing! :) I too noticed the remaining PMake issues that you summarized. Very annoying. Would be great to have them fixed as well. Patches are most welcome! I've just come back from a session with patching up the FreeBSD 10 kernel, investigating the SOCK_RAW problems that pimd has had. There is no problems for SMCRoute since it does not compose or interpret any IP header, where FreeBSD raw sockets deviate from the rest of the *BSD and Linux. |
About the Makefile: the line There seem 3 solutions. I'm not familiar enough with Makefiles to know what is most common, so I'll ask here first before making a patch:
Links: |
I could compile smcroute without problems, but unfortunately, couldn't yet make it run. Unfortunately, this can be either caused by my lack of understanding of multicast, a misconfiguration of my FreeBSD system, or even a bug in smcroute. First of all, FreeBSD by default does not support multicast. In the FreeBSD forum, the suggestion is to compile the kernel with the support, but I simply loaded it using Without ip_mroute.ko nor ip6_mroute.ko loaded:
With ip_mroute.ko loaded, but not ip6_mroute.ko:
With both ip_mroute.ko and ip6_mroute.ko loaded:
Right now I'm only interested in IPv4 support. My config file is:
My questions are: (1) Is it possible to suppress the IPv6 warning/error? (2) What could be the cause of the Can't assign requested address error? |
The IPv6 multicast routing proc setting does not exist outside Linux, conditionalize it using #ifdef __linux__ (compiler built-in define). Signed-off-by: Joachim Nilsson <[email protected]>
For some reason the legacy code to open a local kernel socket for IPv4 group join/leave (IP_ADD/DROP_MEMBERSHOP) had a completely useless connect() statement in it. It's not needed to do setsockopt() and FreeBSD 10 fails on it -- drop code and simplify. Signed-off-by: Joachim Nilsson <[email protected]>
Well spotted, more Linux anachronisms and bogus legacy code! I've now finally tested the latest code on my FreeBSD box and from what I can see it now works! :) Great tip there to |
1) This project is too small to motivate several subdirectories 2) With a simpler Makefile we can target BSD PMake with less effort This commit is inspired by the discussions in issue #5 Signed-off-by: Joachim Nilsson <[email protected]>
Also, I've just pushed commit 0171caf that flattens the directory structure and Let me know if this helps for you, then we can release this as SMCRoute 2.0 |
@troglobit You are awesome! The program seems to do what it is supposed to do. I run into a minor install issue, and unfortunately, it seems that smcroute is not the solution to my problem after all (told you I was new to multicast). As for the minor install issue, for whatever reason, the unzip that comes with FreeBSD does not seems to extract symlinks:
Right now
To be honest, I'm not sure if this should be your problem (frankly, the only reason why I didn't install the GNU version is because this machine is my (home) router and I like to keep it bare). At least you know. The easiest solution is to just add a rule in the Make file for these two files, and have install depend on these files:
|
Ah, yeah I just recently moved to ChangeLog.md and README.md on behalf of GitHub. So, what problem was it you were trying to solve? Some people like dynamic multicast routing, |
…d system Initial conversion from lightweight configure with homegrown Makefile.in to using full configure + Makefile.am -- heads up, files may be missing from `make dist` or `make install`! This commit should also fix the last issues with install/unzip mentioned in issue #5 -- resulting README and ChangeLog are now copied to archive. Signed-off-by: Joachim Nilsson <[email protected]>
Just a minor additional data point: While smcroute 1.99.2 fails to build on Debian architectures kfreebsd-amd64 and kfreebsd-i386, the current git master (as of commit 7241100) doesn't fail to build anymore. Well done! |
smcroute did not compile on FreeBSD 10.0. I have not yet investigated it, due to a deadline at work in 2 weeks. I'll have a look later. This report is just to track this for myself.
I suspect it has to do with changes in FreeBSD with the compiler, but that is just a hunch.
The text was updated successfully, but these errors were encountered: