Page MenuHomeFreeBSD

Cleanup sctp_syscalls.c
ClosedPublic

Authored by tuexen on Jul 12 2020, 3:09 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Oct 28, 2:04 AM
Unknown Object (File)
Mon, Oct 28, 2:03 AM
Unknown Object (File)
Mon, Oct 28, 2:03 AM
Unknown Object (File)
Mon, Oct 28, 1:52 AM
Unknown Object (File)
Sep 24 2024, 7:34 AM
Unknown Object (File)
Sep 23 2024, 1:05 PM
Unknown Object (File)
Sep 8 2024, 10:33 PM
Unknown Object (File)
Sep 7 2024, 10:43 AM
Subscribers

Details

Summary

The original pattern of an SCTP syscall was

int syscall_name (td, uap)
{
#if (defined(INET) || defined(INET6)) && defined(SCTP)
  body
  return (error);
#else
  return (EOPNOTSUPP);
#endif
}

This was changed in r 363079

int syscall_name (td, uap)
{
#if defined(INET) || defined(INET6)
  body
  return (error);
#endif
}

This does not work when neither INET nor INET6 is defined, since the function is expected to return an int. I think this file is not intended to be compiled in this case, therefore I propose to remove the #ifdefs.

sys/conf/files contains

netinet/sctp_syscalls.c		optional inet sctp | inet6 sctp

and the SCTP module should also not be compiled on a kernel not supporting INET and not supporting INET6.

If the above analysis is not correct, one needs to re-add some #else clauses.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

markj added inline comments.
sys/netinet/sctp_syscalls.c
35 ↗(On Diff #74358)

Do we still need opt_sctp.h?

sys/netinet/sctp_syscalls.c
35 ↗(On Diff #74358)

Isn't it needed for the #ifdef SCTP I just re-added to register the syscalls?

sys/netinet/sctp_syscalls.c
35 ↗(On Diff #74358)

Indeed, I was looking at the previous revision of this file.

This revision was not accepted when it landed; it landed in state Needs Review.Jul 12 2020, 6:34 PM
This revision was automatically updated to reflect the committed changes.