Page MenuHomeFreeBSD

Cleanup sctp_syscalls.c
ClosedPublic

Authored by tuexen on Jul 12 2020, 3:09 PM.
Tags
None
Referenced Files
Unknown Object (File)
Dec 22 2023, 11:46 PM
Unknown Object (File)
Sep 16 2023, 5:46 PM
Unknown Object (File)
Sep 16 2023, 5:46 PM
Unknown Object (File)
Sep 16 2023, 5:42 PM
Unknown Object (File)
Sep 16 2023, 4:30 PM
Unknown Object (File)
Aug 27 2023, 2:35 PM
Unknown Object (File)
Aug 13 2023, 6:31 AM
Unknown Object (File)
Jun 27 2023, 9:59 PM
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.