Subject: sin6_flowinfo and sendto/recvfrom

From: Jun-ichiro itojun Hagino <[email-masked]>
Date: Tue, 13 Jun 2000 21:02:58 +0900

hello, I'm having hard time trying to remember sin6_flowinfo semantics.

	RFC2553/2292 are not very clear to me.  for example, could someone
	answer these questions?
	(1) on recvfrom, how sin6_flowinfo should be filled?
	(2) on sendto, how will the kernel interpret sin6_flowinfo from the
	    userland?
	(3) any other interface to manipulate traffic class/flow label?

	from my personal email archive, there are mixed opinions, and the
	discussion did not reflected into 2553/2292.
	- Eric's summary: (IPng 6324)
	  (1) sin6_flowinfo will be filled by ip6->ip6_flow.
	  (2) sin6_flowinfo will be copied into ip6->ip6_flow.
	      if you do not want any special behavior, userland programs should
	      fill it by 0.
	  (3) nope.

>No, it just means that the naive flow label unaware UDP application
>needs to clear sin6_flowinfo in the address it got from recvfrom
>before it uses that address in a sendto call. That is what we will document
>here at Sun.

	- Alexey's summary: (IPng 6334)
	  (1) sin6_flowinfo will be filled by zero.
	  (2) sin6_flowinfo must carry traffic class bits only.
	  (3) setsockopt or ancillary data (but how?).

>The conclusion: sin6_flowinfo mbz in recvfrom(), and may contain
>only class bits in sendto(). It is much more convenient to make with
>setsockopt() or ancillary data.

	It seems to me that Eric is more in sync with the current documents,
	since there's no standard setsockopt nor ancillary data to manipulate
	traffic class/flow label fields.

	i'd love to see it clarificed in near future 2553bis/2292bis.

itojun
--------------------------------------------------------------------
IETF IPng Working Group Mailing List
IPng Home Page:                      http://playground.sun.com/ipng
FTP archive:                      ftp://playground.sun.com/pub/ipng
Direct all administrative requests to [email-masked]
--------------------------------------------------------------------

---

From: Jun-ichiro itojun Hagino <[email-masked]>
Date: Tue, 13 Jun 2000 21:07:05 +0900

>	(3) any other interface to manipulate traffic class/flow label?

	more questions (I could not find answer from my archive):
	(4) what happens if we connect(2) with sin6_flowinfo filled?
		my guess is that sin6_flowinfo sticks into pcb, and
		will be attached to every packet we will send.
	(5) what happens if we bind(2) with sin6_flowinfo filled?
		my guess is (a) to raise some error, or (b) accept packets
		only if they carry specified ip6->ip6_flow field.
	(6) what is the endian of sin6_flowinfo?
		I guess it is network byte order, since it appears on the wire.
	(7) what happens if the peer transmits packets with ip6->ip6_flow set,
	    and it is connection oriented socket (SOCK_STREAM)?

itojun