summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRuslan Ermilov <ru@FreeBSD.org>2001-03-09 12:22:51 +0000
committerRuslan Ermilov <ru@FreeBSD.org>2001-03-09 12:22:51 +0000
commit8ce3f3dd285da85a777c96dc238db4909ff9e7f1 (patch)
tree81a094c70fb58f13632864f7c9ce7fbcc882a9c4
parent288c7d772ca22a14a3dcf97aac2ffb81d4d53d71 (diff)
Notes
-rw-r--r--share/man/man4/ip.412
-rw-r--r--sys/netinet/ip_icmp.c2
-rw-r--r--sys/netinet/raw_ip.c5
3 files changed, 10 insertions, 9 deletions
diff --git a/share/man/man4/ip.4 b/share/man/man4/ip.4
index cd37c7e377ef..331b1e306c2e 100644
--- a/share/man/man4/ip.4
+++ b/share/man/man4/ip.4
@@ -32,9 +32,9 @@
.\" @(#)ip.4 8.2 (Berkeley) 11/30/93
.\" $FreeBSD$
.\"
-.Dd November 30, 1993
+.Dd March 3, 2001
.Dt IP 4
-.Os BSD 4.2
+.Os
.Sh NAME
.Nm ip
.Nd Internet Protocol
@@ -100,9 +100,9 @@ may be used to set the type-of-service and time-to-live
fields in the
.Tn IP
header for
-.Dv SOCK_STREAM
-and
-.Dv SOCK_DGRAM
+.Dv SOCK_STREAM , SOCK_DGRAM ,
+and certain types of
+.Dv SOCK_RAW
sockets.
For example,
.Bd -literal
@@ -355,7 +355,7 @@ setsockopt(s, IPPROTO_IP, IP_HDRINCL, &hincl, sizeof(hincl));
.Ed
.Pp
Unlike previous
-.Tn BSD
+.Bx
releases, the program must set all
the fields of the IP header, including the following:
.Bd -literal
diff --git a/sys/netinet/ip_icmp.c b/sys/netinet/ip_icmp.c
index bdcc88438ab6..95b7197beaaf 100644
--- a/sys/netinet/ip_icmp.c
+++ b/sys/netinet/ip_icmp.c
@@ -638,7 +638,7 @@ icmp_reflect(m)
ia = TAILQ_FIRST(&in_ifaddrhead);
t = IA_SIN(ia)->sin_addr;
ip->ip_src = t;
- ip->ip_ttl = MAXTTL;
+ ip->ip_ttl = ip_defttl;
if (optlen > 0) {
register u_char *cp;
diff --git a/sys/netinet/raw_ip.c b/sys/netinet/raw_ip.c
index a6e850f5ecc2..8d5c6d19534f 100644
--- a/sys/netinet/raw_ip.c
+++ b/sys/netinet/raw_ip.c
@@ -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, struct proc *p)
inp = (struct inpcb *)so->so_pcb;
inp->inp_vflag |= INP_IPV4;
inp->inp_ip_p = proto;
+ inp->inp_ip_ttl = ip_defttl;
#ifdef IPSEC
error = ipsec_init_policy(so, &inp->inp_sp);
if (error != 0) {