Skip to content

Commit

Permalink
s/ipv6/ip6/ for variable names
Browse files Browse the repository at this point in the history
  • Loading branch information
itojun committed Oct 28, 2002
1 parent 2c8e590 commit f98741b
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 42 deletions.
26 changes: 13 additions & 13 deletions openbsd/sys/netinet/tcp_input.c
Expand Up @@ -421,7 +421,7 @@ tcp_input(struct mbuf *m, ...)
va_list ap;
struct tcphdr *th;
#ifdef INET6
struct ip6_hdr *ipv6 = NULL;
struct ip6_hdr *ip6 = NULL;
struct sockaddr_in6 *src_sa6, *dst_sa6, lsa6;
#endif /* INET6 */
#ifdef IPSEC
Expand Down Expand Up @@ -515,7 +515,7 @@ tcp_input(struct mbuf *m, ...)

ip = NULL;
#ifdef INET6
ipv6 = NULL;
ip6 = NULL;
#endif
switch (af) {
case AF_INET:
Expand Down Expand Up @@ -559,15 +559,15 @@ tcp_input(struct mbuf *m, ...)
}
#ifdef INET6
case AF_INET6:
ipv6 = mtod(m, struct ip6_hdr *);
ip6 = mtod(m, struct ip6_hdr *);
tlen = m->m_pkthdr.len - iphlen;
#ifdef TCP_ECN
iptos = (ntohl(ipv6->ip6_flow) >> 20) & 0xff;
iptos = (ntohl(ip6->ip6_flow) >> 20) & 0xff;
#endif

/* Be proactive about malicious use of IPv4 mapped address */
if (IN6_IS_ADDR_V4MAPPED(&ipv6->ip6_src) ||
IN6_IS_ADDR_V4MAPPED(&ipv6->ip6_dst)) {
if (IN6_IS_ADDR_V4MAPPED(&ip6->ip6_src) ||
IN6_IS_ADDR_V4MAPPED(&ip6->ip6_dst)) {
/* XXX stat */
goto drop;
}
Expand All @@ -580,7 +580,7 @@ tcp_input(struct mbuf *m, ...)
* Note that packets with unspecified IPv6 destination is
* already dropped in ip6_input.
*/
if (IN6_IS_ADDR_UNSPECIFIED(&ipv6->ip6_src)) {
if (IN6_IS_ADDR_UNSPECIFIED(&ip6->ip6_src)) {
/* XXX stat */
goto drop;
}
Expand Down Expand Up @@ -621,7 +621,7 @@ tcp_input(struct mbuf *m, ...)
break;
#ifdef INET6
case AF_INET6:
ipv6 = mtod(m, struct ip6_hdr *);
ip6 = mtod(m, struct ip6_hdr *);
break;
#endif
}
Expand Down Expand Up @@ -692,7 +692,7 @@ tcp_input(struct mbuf *m, ...)
#ifdef INET6
flags = INPLOOKUP_WILDCARD | INPLOOKUP_IPV6;
#if defined(NFAITH) && NFAITH > 0
if (faithprefix(&ipv6->ip6_dst))
if (faithprefix(&ip6->ip6_dst))
flags |= INPLOOKUP_FAITH;
#endif
inp = in_pcblookup(&tcbtable, src_sa6,
Expand Down Expand Up @@ -778,7 +778,7 @@ tcp_input(struct mbuf *m, ...)
* handling - worse, they are not exactly the same.
* I believe 5.5.4 is the best one, so we follow 5.5.4.
*/
if (ipv6 && !ip6_use_deprecated) {
if (ip6 && !ip6_use_deprecated) {
struct in6_ifaddr *ia6;

if ((ia6 = ip6_getdstifaddr(m)) &&
Expand Down Expand Up @@ -866,7 +866,7 @@ tcp_input(struct mbuf *m, ...)
* inherit socket options from the listening
* socket.
*/
if (ipv6) {
if (ip6) {
inp->inp_flags |=
(oldinpcb->inp_flags & IN6P_CONTROLOPTS);
if (inp->inp_flags & IN6P_CONTROLOPTS) {
Expand Down Expand Up @@ -1187,7 +1187,7 @@ tcp_input(struct mbuf *m, ...)
switch (af) {
#ifdef INET6
case AF_INET6:
if (IN6_IS_ADDR_MULTICAST(&ipv6->ip6_dst))
if (IN6_IS_ADDR_MULTICAST(&ip6->ip6_dst))
goto drop;
break;
#endif /* INET6 */
Expand Down Expand Up @@ -2327,7 +2327,7 @@ tcp_input(struct mbuf *m, ...)
#ifdef INET6
case AF_INET6:
/* For following calls to tcp_respond */
if (IN6_IS_ADDR_MULTICAST(&ipv6->ip6_dst))
if (IN6_IS_ADDR_MULTICAST(&ip6->ip6_dst))
goto drop;
break;
#endif /* INET6 */
Expand Down
12 changes: 6 additions & 6 deletions openbsd/sys/netinet/tcp_output.c
Expand Up @@ -1120,16 +1120,16 @@ tcp_output(tp)
#ifdef INET6
case AF_INET6:
{
struct ip6_hdr *ipv6;
struct ip6_hdr *ip6;

ipv6 = mtod(m, struct ip6_hdr *);
ipv6->ip6_plen = m->m_pkthdr.len -
ip6 = mtod(m, struct ip6_hdr *);
ip6->ip6_plen = m->m_pkthdr.len -
sizeof(struct ip6_hdr);
ipv6->ip6_nxt = IPPROTO_TCP;
ipv6->ip6_hlim = in6_selecthlim(tp->t_inpcb, NULL);
ip6->ip6_nxt = IPPROTO_TCP;
ip6->ip6_hlim = in6_selecthlim(tp->t_inpcb, NULL);
#ifdef TCP_ECN
if (needect)
ipv6->ip6_flow |= htonl(IPTOS_ECN_ECT0 << 20);
ip6->ip6_flow |= htonl(IPTOS_ECN_ECT0 << 20);
#endif
}
ip6oflags = so->so_options & SO_DONTROUTE;
Expand Down
46 changes: 23 additions & 23 deletions openbsd/sys/netinet/udp_usrreq.c
Expand Up @@ -216,7 +216,7 @@ udp_input(struct mbuf *m, ...)
#endif /* INET6 */
} srcsa, dstsa;
#ifdef INET6
struct ip6_hdr *ipv6;
struct ip6_hdr *ip6;
struct sockaddr_in6 *src_sa6, src_sa6_storage,
*dst_sa6, dst_sa6_storage;
struct ip6_recvpktopts opts6;
Expand Down Expand Up @@ -249,14 +249,14 @@ udp_input(struct mbuf *m, ...)
case 4:
ip = mtod(m, struct ip *);
#ifdef INET6
ipv6 = NULL;
ip6 = NULL;
#endif /* INET6 */
srcsa.sa.sa_family = AF_INET;
break;
#ifdef INET6
case 6:
ip = NULL;
ipv6 = mtod(m, struct ip6_hdr *);
ip6 = mtod(m, struct ip6_hdr *);
srcsa.sa.sa_family = AF_INET6;
break;
#endif /* INET6 */
Expand Down Expand Up @@ -289,8 +289,8 @@ udp_input(struct mbuf *m, ...)
return;
}
#ifdef INET6
if (ipv6) {
ipv6 = mtod(m, struct ip6_hdr *);
if (ip6) {
ip6 = mtod(m, struct ip6_hdr *);
/*
* extract full sockaddr structures for the src/dst
* addresses, and make local copies of them.
Expand Down Expand Up @@ -345,10 +345,10 @@ udp_input(struct mbuf *m, ...)
*/
savesum = uh->uh_sum;
#ifdef INET6
if (ipv6) {
if (ip6) {
/* Be proactive about malicious use of IPv4 mapped address */
if (IN6_IS_ADDR_V4MAPPED(&ipv6->ip6_src) ||
IN6_IS_ADDR_V4MAPPED(&ipv6->ip6_dst)) {
if (IN6_IS_ADDR_V4MAPPED(&ip6->ip6_src) ||
IN6_IS_ADDR_V4MAPPED(&ip6->ip6_dst)) {
/* XXX stat */
goto bad;
}
Expand Down Expand Up @@ -409,7 +409,7 @@ udp_input(struct mbuf *m, ...)
srcsa.sin6.sin6_family = AF_INET6;
srcsa.sin6.sin6_port = uh->uh_sport;
#if 0 /*XXX inbound flowinfo */
srcsa.sin6.sin6_flowinfo = htonl(0x0fffffff) & ipv6->ip6_flow;
srcsa.sin6.sin6_flowinfo = htonl(0x0fffffff) & ip6->ip6_flow;
#endif
sa6_copy_addr(src_sa6, &srcsa.sin6);
/*
Expand All @@ -430,7 +430,7 @@ udp_input(struct mbuf *m, ...)
}

#ifdef INET6
if ((ipv6 && IN6_IS_ADDR_MULTICAST(&ipv6->ip6_dst)) ||
if ((ip6 && IN6_IS_ADDR_MULTICAST(&ip6->ip6_dst)) ||
(ip && IN_MULTICAST(ip->ip_dst.s_addr)) ||
(ip && in_broadcast(ip->ip_dst, m->m_pkthdr.rcvif)))
#else /* INET6 */
Expand Down Expand Up @@ -467,15 +467,15 @@ udp_input(struct mbuf *m, ...)
inp = inp->inp_queue.cqe_next) {
#ifdef INET6
/* don't accept it if AF does not match */
if (ipv6 && !(inp->inp_flags & INP_IPV6))
if (ip6 && !(inp->inp_flags & INP_IPV6))
continue;
if (!ipv6 && (inp->inp_flags & INP_IPV6))
if (!ip6 && (inp->inp_flags & INP_IPV6))
continue;
#endif
if (inp->inp_lport != uh->uh_dport)
continue;
#ifdef INET6
if (ipv6) {
if (ip6) {
if (!SA6_IS_ADDR_UNSPECIFIED(&inp->in6p_lsa))
if (!SA6_ARE_ADDR_EQUAL(&inp->in6p_lsa,
dst_sa6))
Expand All @@ -488,7 +488,7 @@ udp_input(struct mbuf *m, ...)
continue;
}
#ifdef INET6
if (ipv6) {
if (ip6) {
if (!SA6_IS_ADDR_UNSPECIFIED(&inp->in6p_fsa))
if (!SA6_ARE_ADDR_EQUAL(&inp->in6p_fsa,
src_sa6) ||
Expand Down Expand Up @@ -650,8 +650,8 @@ udp_input(struct mbuf *m, ...)
if ((n = m_copy(m, 0, M_COPYALL)) != NULL) {
opts = NULL;
#ifdef INET6
if (ipv6 && (inp->inp_flags & IN6P_CONTROLOPTS)) {
ip6_savecontrol(inp, ipv6,
if (ip6 && (inp->inp_flags & IN6P_CONTROLOPTS)) {
ip6_savecontrol(inp, ip6,
n, &opts6);
opts = opts6.head;
}
Expand Down Expand Up @@ -711,8 +711,8 @@ udp_input(struct mbuf *m, ...)

opts = NULL;
#ifdef INET6
if (ipv6 && (inp->inp_flags & IN6P_CONTROLOPTS)) {
ip6_savecontrol(inp, ipv6, m, &opts6);
if (ip6 && (inp->inp_flags & IN6P_CONTROLOPTS)) {
ip6_savecontrol(inp, ip6, m, &opts6);
opts = opts6.head;
}
#endif /* INET6 */
Expand All @@ -729,7 +729,7 @@ udp_input(struct mbuf *m, ...)
* Locate pcb for datagram.
*/
#ifdef INET6
if (ipv6)
if (ip6)
inp = in6_pcbhashlookup(&udbtable, src_sa6, uh->uh_sport,
dst_sa6, uh->uh_dport);
else
Expand All @@ -739,7 +739,7 @@ udp_input(struct mbuf *m, ...)
if (inp == 0) {
++udpstat.udps_pcbhashmiss;
#ifdef INET6
if (ipv6) {
if (ip6) {
inp = in_pcblookup(&udbtable,
src_sa6, uh->uh_sport, dst_sa6,
uh->uh_dport, INPLOOKUP_WILDCARD | INPLOOKUP_IPV6);
Expand All @@ -754,7 +754,7 @@ udp_input(struct mbuf *m, ...)
goto bad;
}
#ifdef INET6
if (ipv6) {
if (ip6) {
icmp6_error(m, ICMP6_DST_UNREACH,
ICMP6_DST_UNREACH_NOPORT,0);
} else
Expand Down Expand Up @@ -817,8 +817,8 @@ udp_input(struct mbuf *m, ...)

opts = NULL;
#ifdef INET6
if (ipv6 && (inp->inp_flags & IN6P_CONTROLOPTS)) {
ip6_savecontrol(inp, ipv6, m, &opts6);
if (ip6 && (inp->inp_flags & IN6P_CONTROLOPTS)) {
ip6_savecontrol(inp, ip6, m, &opts6);
opts = opts6.head;
}
#endif /* INET6 */
Expand Down

0 comments on commit f98741b

Please sign in to comment.