Skip to content

Commit

Permalink
[libu] fix "overflow in implicit constant conversion" for uint8 sctp …
Browse files Browse the repository at this point in the history
…event fields
  • Loading branch information
tho committed Dec 26, 2009
1 parent 0314194 commit 69339fe
Showing 1 changed file with 26 additions and 9 deletions.
35 changes: 26 additions & 9 deletions srcs/toolbox/net.c
Expand Up @@ -985,15 +985,32 @@ static int sctp_enable_events (int s, int o)
{
struct sctp_event_subscribe e;

e.sctp_data_io_event = (o & U_NET_OPT_SCTP_DATA_IO_EVENT);
e.sctp_association_event = (o & U_NET_OPT_SCTP_ASSOCIATION_EVENT);
e.sctp_address_event = (o & U_NET_OPT_SCTP_ADDRESS_EVENT);
e.sctp_send_failure_event = (o & U_NET_OPT_SCTP_SEND_FAILURE_EVENT);
e.sctp_peer_error_event = (o & U_NET_OPT_SCTP_PEER_ERROR_EVENT);
e.sctp_shutdown_event = (o & U_NET_OPT_SCTP_SHUTDOWN_EVENT);
e.sctp_partial_delivery_event = (o & U_NET_OPT_SCTP_PARTIAL_DELIVERY_EVENT);
e.sctp_adaptation_layer_event = (o & U_NET_OPT_SCTP_ADAPTATION_LAYER_EVENT);
e.sctp_authentication_event = (o & U_NET_OPT_SCTP_AUTHENTICATION_EVENT);
e.sctp_data_io_event =
(o & U_NET_OPT_SCTP_DATA_IO_EVENT) ? 1 : 0;

e.sctp_association_event =
(o & U_NET_OPT_SCTP_ASSOCIATION_EVENT) ? 1 : 0;

e.sctp_address_event =
(o & U_NET_OPT_SCTP_ADDRESS_EVENT) ? 1 : 0;

e.sctp_send_failure_event =
(o & U_NET_OPT_SCTP_SEND_FAILURE_EVENT) ? 1 : 0;

e.sctp_peer_error_event =
(o & U_NET_OPT_SCTP_PEER_ERROR_EVENT) ? 1 : 0;

e.sctp_shutdown_event =
(o & U_NET_OPT_SCTP_SHUTDOWN_EVENT) ? 1 : 0;

e.sctp_partial_delivery_event =
(o & U_NET_OPT_SCTP_PARTIAL_DELIVERY_EVENT) ? 1 : 0;

e.sctp_adaptation_layer_event =
(o & U_NET_OPT_SCTP_ADAPTATION_LAYER_EVENT) ? 1 : 0;

e.sctp_authentication_event =
(o & U_NET_OPT_SCTP_AUTHENTICATION_EVENT) ? 1 : 0;

dbg_err_if (u_setsockopt(s, IPPROTO_SCTP, SCTP_EVENTS, &e, sizeof e) == -1);

Expand Down

0 comments on commit 69339fe

Please sign in to comment.