Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 8 Oct 1999 16:09:55 +0200
From:      Wim Livens <livensw@rc.bel.alcatel.be>
To:        freebsd-net@freebsd.org
Subject:   IP_TOS on raw socket
Message-ID:  <19991008160955.A1671@rc.bel.alcatel.be>

next in thread | raw e-mail | index | archive | help

I've noticed that the IP_TOS socket option doesn't work on raw
sockets.  There is no error returned and the TOS is stored in the
protocol control block but when the packet headers are constructed, a
hardcoded zero is put (instead of inp->inp_ip_tos).

Is there any specific reason for this or is this a bug ?

(I don't want to use IP_HDRINCL).

Here an extract from netinet/raw_ip.c:

int
rip_output(m, so, dst)
...
		ip->ip_tos = 0;
		ip->ip_off = 0;
		ip->ip_p = inp->inp_ip_p;
		ip->ip_len = m->m_pkthdr.len;
		ip->ip_src = inp->inp_laddr;
		ip->ip_dst.s_addr = dst;
		ip->ip_ttl = MAXTTL;

Clearly, the same holds for the ttl.

BTW, the linux implementation does allow to set the tos on raw sockets.

Thanks for any comments,

-- 
Wim Livens.

Alcatel - Corporate Research Center     wim.livens@alcatel.be
Fr. Wellesplein 1                       livensw@rc.bel.alcatel.be
B-2018 Antwerpen                Tel:    +32 3 240 7570
Belgium.                        Fax:    +32 3 240 9932


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-net" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?19991008160955.A1671>