Recently encountered a problem about SCTP: a product runs on Monta Vista, its kernel version number is 2.6.21, but each time the product is on our red Hat Enterprise Linux 5.5, the error message is as follows:
^?0 2011-08-16 09:11:57.316267 coolnjmcl018 ammserv 26555[26566]. /com/ammssctplib.cc,369 [EAMMS1315] ammssctplib::ammssetsockopt () setsockopt-invalid argument
^?1 2011-08-16 09:11:57.316326 coolnjmcl018 Ammserv 26555[26566]. /com/ammsaccessserver.cc,779 [EAMMS1036] ammsaccessserver::setsocketopts (): Failed to set sctp_events for socket 6
Ammssetsockopt () called the Linux API setsockopt (). Product colleagues told us that they upgraded the libsctp.so, so we copy the MV in the shared Lib to Rhel, the problem remains. Later we thought that the RHEL5.5 kernel was inconsistent with the Monta Vista kernel, so I upgraded the Rhel kernel from 2.6.18-194.el5 to 2.6.18-238.9.1.el5, and the problem still remains. While we were still considering whether to replace our server with Monta Vista, a colleague was http://centos.org/modules/newbb/viewtopic.php?viewmode=threaded& Order=asc&topic_id=18994&forum=37&move=next&topic_time=1236769500 's inspiration, put setsockopt () The last parameter changed from sizeof (events) to 8, unexpectedly succeeded. Events are defined as follows.
Finally, it was found that the definition of struct sctp_event_subscribe in RHEL5 and RHEL6 was completely different. To solve the problem above, only upgrade the operating system to RHEL6.
Definition in RHEL5: http://rhkernel.org/RHEL5+2.6.18-194.el5/include/net/sctp/user.h#L367
/*
364 * described in section 7.3
365 * Ancillary Data and Notification interest Options
366/
367str UCT Sctp_event_subscribe {
368 __u8 sctp_data_io_event;
369 __u8 sctp_association_event;
370 __u8 sctp_address_event;
371 __u8 sctp_send_failure_event;
372 __u8 sctp_peer_error_event;
373 __u8 sctp_shutdown_event;
374 __u8 sctp_partial_delivery_event;
375 __u8 sctp_adaption_layer_event;
376};
Definition in RHEL 6: http://rhkernel.org/RHEL6+2.6.32-71.18.2.el6/include/net/sctp/user.h#L406
/*
403 * described in section 7.3
404 * Ancillary Data and Notification interest Options
405/
406str UCT Sctp_event_subscribe {
407 __u8 sctp_data_io_event;
408 __u8 sctp_association_event;
409 __u8 sctp_address_event;
410 __u8 sctp_send_failure_event;
411 __u8 sctp_peer_error_event;
412 __u8 sctp_shutdown_event;
413 __u8 sctp_partial_delivery_event;
414 __u8 sctp_adaptation_layer_event;
415 __u8 sctp_authentication_event;
416};
417