Changeset View
Changeset View
Standalone View
Standalone View
head/usr.sbin/iscsid/iscsid.c
Show First 20 Lines • Show All 291 Lines • ▼ Show 20 Lines | if (to_ai->ai_family == AF_INET6) { | ||||
if (setsockopt(conn->conn_socket, | if (setsockopt(conn->conn_socket, | ||||
IPPROTO_IPV6, IPV6_TCLASS, | IPPROTO_IPV6, IPV6_TCLASS, | ||||
&tos, sizeof(tos)) == -1) | &tos, sizeof(tos)) == -1) | ||||
log_warn("setsockopt(IPV6_TCLASS) " | log_warn("setsockopt(IPV6_TCLASS) " | ||||
"failed for %s", | "failed for %s", | ||||
from_addr); | from_addr); | ||||
} | } | ||||
} | } | ||||
if (conn->conn_conf.isc_pcp != -1) { | |||||
int pcp = conn->conn_conf.isc_pcp; | |||||
if (to_ai->ai_family == AF_INET) { | |||||
if (setsockopt(conn->conn_socket, | |||||
IPPROTO_IP, IP_VLAN_PCP, | |||||
&pcp, sizeof(pcp)) == -1) | |||||
log_warn("setsockopt(IP_VLAN_PCP) " | |||||
"failed for %s", | |||||
from_addr); | |||||
} else | |||||
if (to_ai->ai_family == AF_INET6) { | |||||
if (setsockopt(conn->conn_socket, | |||||
IPPROTO_IPV6, IPV6_VLAN_PCP, | |||||
&pcp, sizeof(pcp)) == -1) | |||||
log_warn("setsockopt(IPV6_VLAN_PCP) " | |||||
"failed for %s", | |||||
from_addr); | |||||
} | |||||
} | |||||
if (from_ai != NULL) { | if (from_ai != NULL) { | ||||
error = bind(conn->conn_socket, from_ai->ai_addr, | error = bind(conn->conn_socket, from_ai->ai_addr, | ||||
from_ai->ai_addrlen); | from_ai->ai_addrlen); | ||||
if (error != 0) { | if (error != 0) { | ||||
fail(conn, strerror(errno)); | fail(conn, strerror(errno)); | ||||
log_err(1, "failed to bind to %s", from_addr); | log_err(1, "failed to bind to %s", from_addr); | ||||
} | } | ||||
} | } | ||||
▲ Show 20 Lines • Show All 355 Lines • Show Last 20 Lines |