Fix build failure on freebsd due to missing data declaration
@@ -1105,12 +1105,14 @@ static int extract_local(BIO *b, MSGHDR_TYPE *mh, BIO_ADDR *local) {
static int pack_local(BIO *b, MSGHDR_TYPE *mh, const BIO_ADDR *local) {
int af = dgram_get_sock_family(b);
+# if defined(IP_PKTINFO) || defined(IP_RECVDSTADDR) || defined(IPV6_PKTINFO)
+ CMSGHDR_TYPE *cmsg;
+ bio_dgram_data *data = b->ptr;
+# endif
if (af == AF_INET) {
# if defined(IP_PKTINFO)
- CMSGHDR_TYPE *cmsg;
struct in_pktinfo *info;
- bio_dgram_data *data = b->ptr;
# if defined(OPENSSL_SYS_WINDOWS)
cmsg = (CMSGHDR_TYPE *)mh->Control.buf;
@@ -1147,8 +1149,6 @@ static int pack_local(BIO *b, MSGHDR_TYPE *mh, const BIO_ADDR *local) {
return 1;
# elif defined(IP_SENDSRCADDR)
- {
- struct cmsghdr *cmsg;
struct in_addr *info;
cmsg = (struct cmsghdr *)mh->msg_control;
@@ -1158,7 +1158,6 @@ static int pack_local(BIO *b, MSGHDR_TYPE *mh, const BIO_ADDR *local) {
info = (struct in_addr *)BIO_CMSG_DATA(cmsg);
*info = local->s_in.sin_addr;
- }
/* See comment above. */
if (local->s_in.sin_port != 0
@@ -1174,9 +1173,7 @@ static int pack_local(BIO *b, MSGHDR_TYPE *mh, const BIO_ADDR *local) {
# if OPENSSL_USE_IPV6
else if (af == AF_INET6) {
# if defined(IPV6_PKTINFO)
- CMSGHDR_TYPE *cmsg;
struct in6_pktinfo *info;
- bio_dgram_data *data = b->ptr;
# if defined(OPENSSL_SYS_WINDOWS)
cmsg = (CMSGHDR_TYPE *)mh->Control.buf;
