Page MenuHomeFreeBSD

UDP-Lite fixes
ClosedPublic

Authored by bz on Sep 17 2015, 11:24 AM.
Tags
None
Referenced Files
F103007091: D3686.id8857.diff
Tue, Nov 19, 6:19 PM
F102935108: D3686.diff
Mon, Nov 18, 11:07 PM
Unknown Object (File)
Thu, Oct 31, 4:31 AM
Unknown Object (File)
Sep 29 2024, 6:01 PM
Unknown Object (File)
Sep 19 2024, 12:55 AM
Unknown Object (File)
Sep 18 2024, 9:47 PM
Unknown Object (File)
Sep 17 2024, 11:41 AM
Unknown Object (File)
Sep 4 2024, 4:02 AM
Subscribers

Details

Summary

In the UDP over IPv6 implementation several cases are using the wrong protocol, e.g., based on wrong "next header" assumptions (which does not have to point to the upper layer protocol), or using hard-coded UDP instead of UDP or UDP-Lite switching protocols.
Fix those cases for UDP-Lite it to work correctly.

PR: 202788
Submitted by: Tiwei Bie (btw mail.ustc.edu.cn) (one part)
MFC After: 2 weeks

https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=202788

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

bz retitled this revision from to UDP-Lite fixes.
bz updated this object.
bz edited the test plan for this revision. (Show Details)
bz added reviewers: adrian, gnn, kevlo.
bz set the repository for this revision to rS FreeBSD src repository - subversion.
bz added a subscriber: network.
kevlo edited edge metadata.

You're right, we should use "proto" to get the UDP or UDP-Lite.
Thanks for fixing it.

This revision is now accepted and ready to land.Sep 17 2015, 2:26 PM
sys/netinet6/udp6_usrreq.c
1236

If we are going to replace the hard-coded UDP used in ip_protox[]
with UDP or UDP-Lite switching protocols, should we do that in all
cases? (I know UDP and UDP-Lite share udp_usrreqs)

Such as these codes:

static void
udp6_abort(struct socket *so)
{
	......

#ifdef INET
	if (inp->inp_vflag & INP_IPV4) {
		struct pr_usrreqs *pru;

		pru = inetsw[ip_protox[IPPROTO_UDP]].pr_usrreqs;
		(*pru->pru_abort)(so);
		return;
	}
#endif
	......
}

static void
udp6_close(struct socket *so)
{
	......

#ifdef INET
	if (inp->inp_vflag & INP_IPV4) {
		struct pr_usrreqs *pru;

		pru = inetsw[ip_protox[IPPROTO_UDP]].pr_usrreqs;
		(*pru->pru_disconnect)(so);
		return;
	}
#endif

	......
}

static int
udp6_disconnect(struct socket *so)
{
	......

#ifdef INET
	if (inp->inp_vflag & INP_IPV4) {
		struct pr_usrreqs *pru;

		pru = inetsw[ip_protox[IPPROTO_UDP]].pr_usrreqs;
		(void)(*pru->pru_disconnect)(so);
		return (0);
	}
#endif

	......

}

Thanks! :-)

bz edited edge metadata.

Update for all ip_protox[] cases.

This revision now requires review to proceed.Sep 19 2015, 11:25 AM
bz marked an inline comment as done.Sep 19 2015, 11:25 AM

Updated to catch the other 3.

btw edited edge metadata.
This revision is now accepted and ready to land.Sep 19 2015, 5:11 PM
gnn edited edge metadata.
This revision was automatically updated to reflect the committed changes.