Hi!

IP_TTL and IP_TOS setsockopt(2) options currently do not take
any effect on raw IP sockets (actually, everything that uses
rip_usrreqs function set).  The attached patch fixes this.

Also, I have the question.  Should we use MAXTTL constant or
net.inet.ip.ttl MIB variable, as the initial value for TTL?

Finally, if anyone has any objections, send them now.


Cheers,
-- 
Ruslan Ermilov          Oracle Developer/DBA,
[EMAIL PROTECTED]           Sunbay Software AG,
[EMAIL PROTECTED]          FreeBSD committer,
+380.652.512.251        Simferopol, Ukraine

http://www.FreeBSD.org  The Power To Serve
http://www.oracle.com   Enabling The Information Age
Index: raw_ip.c
===================================================================
RCS file: /home/ncvs/src/sys/netinet/raw_ip.c,v
retrieving revision 1.73
diff -u -p -r1.73 raw_ip.c
--- raw_ip.c    2001/02/04 13:13:08     1.73
+++ raw_ip.c    2001/03/07 14:26:12
@@ -197,13 +197,13 @@ rip_output(m, so, dst)
                }
                M_PREPEND(m, sizeof(struct ip), M_TRYWAIT);
                ip = mtod(m, struct ip *);
-               ip->ip_tos = 0;
+               ip->ip_tos = inp->inp_ip_tos;
                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;
+               ip->ip_ttl = inp->inp_ip_ttl;
        } else {
                if (m->m_pkthdr.len > IP_MAXPACKET) {
                        m_freem(m);
@@ -458,6 +458,7 @@ rip_attach(struct socket *so, int proto,
        inp = (struct inpcb *)so->so_pcb;
        inp->inp_vflag |= INP_IPV4;
        inp->inp_ip_p = proto;
+       inp->inp_ip_ttl = MAXTTL;
 #ifdef IPSEC
        error = ipsec_init_policy(so, &inp->inp_sp);
        if (error != 0) {

Reply via email to