On Fri, Sep 08, 2017 at 12:05:06AM +0200, Aragon Gouveia wrote:
> Good day,
> 
> There seems to be a multicast related bug with FreeBSD 11.1 and Bird 1.6.3.
> In summary:

Hi

Does attached patch fixes the issue, or is it something different?

-- 
Elen sila lumenn' omentielvo

Ondrej 'Santiago' Zajicek (email: [email protected])
OpenPGP encrypted e-mails preferred (KeyID 0x11DEADC3, wwwkeys.pgp.net)
"To err is human -- to blame it on a computer is even more so."
commit f6e6c3b5a5997ffc67d96785bbde76bcec072890
Author: Ondrej Zajicek (work) <[email protected]>
Date:   Tue Jan 17 13:21:25 2017 +0100

    Fix IP_HDRINCL usage on FreeBSD 11
    
    FreeBSD 11 changed endianity of ip_len field from host order to network
    order. Also DragonFly BSD allegedly expects network order here.
    
    Thanks to Olivier Cochard-Labbé for the patch.

diff --git a/sysdep/bsd/sysio.h b/sysdep/bsd/sysio.h
index 2610a47b..9b10e6e8 100644
--- a/sysdep/bsd/sysio.h
+++ b/sysdep/bsd/sysio.h
@@ -9,6 +9,7 @@
 #include <net/if_dl.h>
 #include <netinet/in_systm.h> // Workaround for some BSDs
 #include <netinet/ip.h>
+#include <sys/param.h>
 
 
 #ifdef __NetBSD__
@@ -179,8 +180,8 @@ sk_prepare_ip_header(sock *s, void *hdr, int dlen)
   ip->ip_src = ipa_to_in4(s->saddr);
   ip->ip_dst = ipa_to_in4(s->daddr);
 
-#ifdef __OpenBSD__
-  /* OpenBSD expects ip_len in network order, other BSDs expect host order */
+#if (defined __OpenBSD__) || (defined __DragonFly__) || (defined __FreeBSD__ && (__FreeBSD_version >= 1100030))
+  /* Different BSDs have different expectations of ip_len endianity */
   ip->ip_len = htons(ip->ip_len);
 #endif
 }

Reply via email to