Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

SCTP service name to number translation clashes with TCP #1431

Open
infrastation opened this issue Jan 9, 2025 · 0 comments
Open

SCTP service name to number translation clashes with TCP #1431

infrastation opened this issue Jan 9, 2025 · 0 comments

Comments

@infrastation
Copy link
Member

$ grep amqp /etc/services 
amqps		5671/tcp			# AMQP protocol over TLS/SSL
amqp		5672/tcp
amqp		5672/sctp

$ filtertest EN10MB 'sctp port amqp'
filtertest: port 'amqp' is tcp

The error message is from this block of gen_scode():

		if (proto == Q_SCTP) {
			if (real_proto == IPPROTO_UDP)
				bpf_error(cstate, "port '%s' is udp", name);

			else if (real_proto == IPPROTO_TCP)
				bpf_error(cstate, "port '%s' is tcp", name);
			else
				/* override PROTO_UNDEF */
				real_proto = IPPROTO_SCTP;
		}

Both the function and pcap-filter(7) imply that name to number translation is supposed to work for SCTP the same as it does for TCP and UDP. However, pcap_nametoport() is not aware of SCTP, so the documentation is different from the implementation.

# for free to join this conversation on GitHub. Already have an account? # to comment
Development

No branches or pull requests

1 participant