Skip to content

Commit

Permalink
Merge pull request #600 from h2o/kazuho/freebsd20241222
Browse files Browse the repository at this point in the history
FreeBSD compatibility
  • Loading branch information
kazuho authored Dec 22, 2024
2 parents ce9f1bd + 922440d commit f336bd8
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion deps/picotls
Submodule picotls updated 1 files
+4 −1 lib/picotls.c
10 changes: 6 additions & 4 deletions src/cli.c
Original file line number Diff line number Diff line change
Expand Up @@ -511,11 +511,13 @@ static void set_srcaddr(struct msghdr *mess, quicly_address_t *addr)
memcpy(CMSG_DATA(cmsg), &info, sizeof(info));
mess->msg_controllen += CMSG_SPACE(sizeof(info));
#elif defined(IP_SENDSRCADDR)
/* TODO FreeBSD: skip setting IP_SENDSRCADDR if the socket is not bound to INADDR_ANY, as doing so results in sendmsg
* generating an error */
cmsg->cmsg_level = IPPROTO_IP;
cmsg->cmsg_type = IP_SENDSRCADDR;
cmsg->cmsg_len = CMSG_LEN(sizeof(addr->sin));
memcpy(CMSG_DATA(cmsg), &addr->sin, sizeof(addr->sin));
mess->msg_controllen += CMSG_SPACE(sizeof(addr->sin));
cmsg->cmsg_len = CMSG_LEN(sizeof(addr->sin.sin_addr));
memcpy(CMSG_DATA(cmsg), &addr->sin.sin_addr, sizeof(addr->sin.sin_addr));
mess->msg_controllen += CMSG_SPACE(sizeof(addr->sin.sin_addr));
#else
assert(!"FIXME");
#endif
Expand All @@ -534,7 +536,7 @@ static void set_srcaddr(struct msghdr *mess, quicly_address_t *addr)
}
}

static void set_ecn(struct msghdr *mess, int ecn)
static void set_ecn(struct msghdr *mess, uint8_t ecn)
{
if (ecn == 0)
return;
Expand Down
2 changes: 1 addition & 1 deletion t/cplusplus.t
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#! /usr/bin/perl
#! /usr/bin/env perl

use strict;
use warnings;
Expand Down

0 comments on commit f336bd8

Please sign in to comment.