From cb26fe7d06ce9d348bf8a158cce722f76ed213b9 Mon Sep 17 00:00:00 2001
From: Christophe Massiot <massiot@videolan.org>
Date: Wed, 21 Dec 2016 17:35:39 +0000
Subject: [PATCH] Set ip length

    This is required to be set and be equal to write size on FreeBSD.
    Note that despite documentation says it should be in host order,
    it only works if specified in network order

commit b551ed495bcc508e614fd14a25912301b1122a17
Author: Dmitry Marakasov <amdmi3@amdmi3.ru>
Date:   Fri Oct 7 17:32:44 2016 +0300
---
 multicat.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/multicat.c b/multicat.c
index 003f077..f822952 100644
--- a/multicat.c
+++ b/multicat.c
@@ -288,6 +288,10 @@ static ssize_t raw_Write( const void *p_buf, size_t i_len )
     #endif
     = htons(sizeof(struct udphdr) + i_len);
 
+    #if defined(__FreeBSD__)
+    pktheader.iph.ip_len = htons(sizeof(struct udprawpkt) + i_len);
+    #endif
+
     iov[0].iov_base = &pktheader;
     iov[0].iov_len = sizeof(struct udprawpkt);
 
-- 
GitLab