Commit 646b24d9 authored by Ondřej Zajíček's avatar Ondřej Zajíček

Minor changes.

parent 44d4ab7a
...@@ -116,11 +116,11 @@ else ...@@ -116,11 +116,11 @@ else
;; ;;
ipv6:netbsd*) sysdesc=bsd-v6 ipv6:netbsd*) sysdesc=bsd-v6
CPPFLAGS="$CPPFLAGS -I/usr/pkg/include" CPPFLAGS="$CPPFLAGS -I/usr/pkg/include"
LDFLAGS="$LDFLAGS -L/usr/pkg/lib" LDFLAGS="$LDFLAGS -L/usr/pkg/lib -R/usr/pkg/lib"
;; ;;
ipv4:netbsd*) sysdesc=bsd ipv4:netbsd*) sysdesc=bsd
CPPFLAGS="$CPPFLAGS -I/usr/pkg/include" CPPFLAGS="$CPPFLAGS -I/usr/pkg/include"
LDFLAGS="$LDFLAGS -L/usr/pkg/lib" LDFLAGS="$LDFLAGS -L/usr/pkg/lib -R/usr/pkg/lib"
;; ;;
ipv6:freebsd*) sysdesc=bsd-v6 ipv6:freebsd*) sysdesc=bsd-v6
;; ;;
......
...@@ -159,6 +159,7 @@ sysio_process_rx_cmsgs(sock *s, struct msghdr *msg) ...@@ -159,6 +159,7 @@ sysio_process_rx_cmsgs(sock *s, struct msghdr *msg)
} }
/* Unfortunately, IP_SENDSRCADDR does not work for raw IP sockets on BSD kernels */ /* Unfortunately, IP_SENDSRCADDR does not work for raw IP sockets on BSD kernels */
/*
static void static void
sysio_prepare_tx_cmsgs(sock *s, struct msghdr *msg, void *cbuf, size_t cbuflen) sysio_prepare_tx_cmsgs(sock *s, struct msghdr *msg, void *cbuf, size_t cbuflen)
{ {
...@@ -174,7 +175,6 @@ sysio_prepare_tx_cmsgs(sock *s, struct msghdr *msg, void *cbuf, size_t cbuflen) ...@@ -174,7 +175,6 @@ sysio_prepare_tx_cmsgs(sock *s, struct msghdr *msg, void *cbuf, size_t cbuflen)
if (s->iface) if (s->iface)
{ {
struct in_addr m; struct in_addr m;
// set_inaddr(&m, s->iface->addr->ip);
set_inaddr(&m, s->saddr); set_inaddr(&m, s->saddr);
setsockopt(s->fd, IPPROTO_IP, IP_MULTICAST_IF, &m, sizeof(m)); setsockopt(s->fd, IPPROTO_IP, IP_MULTICAST_IF, &m, sizeof(m));
} }
...@@ -189,6 +189,7 @@ sysio_prepare_tx_cmsgs(sock *s, struct msghdr *msg, void *cbuf, size_t cbuflen) ...@@ -189,6 +189,7 @@ sysio_prepare_tx_cmsgs(sock *s, struct msghdr *msg, void *cbuf, size_t cbuflen)
msg->msg_controllen = cm->cmsg_len; msg->msg_controllen = cm->cmsg_len;
} }
*/
#endif #endif
......
...@@ -282,7 +282,7 @@ sysio_process_rx_cmsgs(sock *s, struct msghdr *msg) ...@@ -282,7 +282,7 @@ sysio_process_rx_cmsgs(sock *s, struct msghdr *msg)
return; return;
} }
/*
static void static void
sysio_prepare_tx_cmsgs(sock *s, struct msghdr *msg, void *cbuf, size_t cbuflen) sysio_prepare_tx_cmsgs(sock *s, struct msghdr *msg, void *cbuf, size_t cbuflen)
{ {
...@@ -306,4 +306,6 @@ sysio_prepare_tx_cmsgs(sock *s, struct msghdr *msg, void *cbuf, size_t cbuflen) ...@@ -306,4 +306,6 @@ sysio_prepare_tx_cmsgs(sock *s, struct msghdr *msg, void *cbuf, size_t cbuflen)
msg->msg_controllen = cm->cmsg_len; msg->msg_controllen = cm->cmsg_len;
} }
*/
#endif #endif
...@@ -706,6 +706,7 @@ sysio_process_rx_cmsgs(sock *s, struct msghdr *msg) ...@@ -706,6 +706,7 @@ sysio_process_rx_cmsgs(sock *s, struct msghdr *msg)
return; return;
} }
/*
static void static void
sysio_prepare_tx_cmsgs(sock *s, struct msghdr *msg, void *cbuf, size_t cbuflen) sysio_prepare_tx_cmsgs(sock *s, struct msghdr *msg, void *cbuf, size_t cbuflen)
{ {
...@@ -730,6 +731,7 @@ sysio_prepare_tx_cmsgs(sock *s, struct msghdr *msg, void *cbuf, size_t cbuflen) ...@@ -730,6 +731,7 @@ sysio_prepare_tx_cmsgs(sock *s, struct msghdr *msg, void *cbuf, size_t cbuflen)
msg->msg_controllen = cm->cmsg_len; msg->msg_controllen = cm->cmsg_len;
return; return;
} }
*/
#endif #endif
static char * static char *
...@@ -1220,7 +1222,7 @@ sk_maybe_write(sock *s) ...@@ -1220,7 +1222,7 @@ sk_maybe_write(sock *s)
fill_in_sockifa(&sa, s->iface); fill_in_sockifa(&sa, s->iface);
struct iovec iov = {s->tbuf, s->tpos - s->tbuf}; struct iovec iov = {s->tbuf, s->tpos - s->tbuf};
byte cmsg_buf[CMSG_TX_SPACE]; // byte cmsg_buf[CMSG_TX_SPACE];
struct msghdr msg = { struct msghdr msg = {
.msg_name = &sa, .msg_name = &sa,
...@@ -1228,7 +1230,7 @@ sk_maybe_write(sock *s) ...@@ -1228,7 +1230,7 @@ sk_maybe_write(sock *s)
.msg_iov = &iov, .msg_iov = &iov,
.msg_iovlen = 1}; .msg_iovlen = 1};
sysio_prepare_tx_cmsgs(s, &msg, cmsg_buf, sizeof(cmsg_buf)); // sysio_prepare_tx_cmsgs(s, &msg, cmsg_buf, sizeof(cmsg_buf));
e = sendmsg(s->fd, &msg, 0); e = sendmsg(s->fd, &msg, 0);
if (e < 0) if (e < 0)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment