From owner-freebsd-net Fri Oct 8 7: 9:13 1999 Delivered-To: freebsd-net@freebsd.org Received: from btm4r4.alcatel.be (btm4r4.alcatel.be [195.207.101.110]) by hub.freebsd.org (Postfix) with ESMTP id 0A5C714E25 for ; Fri, 8 Oct 1999 07:09:09 -0700 (PDT) (envelope-from livensw@rc.bel.alcatel.be) Received: from btmq9s.rc.bel.alcatel.be (btmq9s.rc.bel.alcatel.be [138.203.65.182]) by btm4r4.alcatel.be (8.9.1a/8.9.1) with ESMTP id QAA12759 for ; Fri, 8 Oct 1999 16:09:08 +0200 (MET DST) Received: (from livensw@localhost) by btmq9s.rc.bel.alcatel.be (8.8.8+Sun/8.8.8) id QAA04309 for freebsd-net@freebsd.org; Fri, 8 Oct 1999 16:09:56 +0200 (MET DST) Date: Fri, 8 Oct 1999 16:09:55 +0200 From: Wim Livens To: freebsd-net@freebsd.org Subject: IP_TOS on raw socket Message-ID: <19991008160955.A1671@rc.bel.alcatel.be> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.95.5i Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org 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