long live the one true internet.
ok henning mikeb
-/* $OpenBSD: bridgestp.c,v 1.50 2014/09/08 06:24:13 jsg Exp $ */
+/* $OpenBSD: bridgestp.c,v 1.51 2014/12/19 17:14:39 tedu Exp $ */
/*
* Copyright (c) 2000 Jason L. Wright (jason@thought.net)
#include <net/if_media.h>
#include <net/netisr.h>
-#ifdef INET
#include <netinet/in.h>
#include <netinet/ip.h>
#include <netinet/if_ether.h>
-#endif
#include <net/if_bridge.h>
-/* $OpenBSD: if.c,v 1.308 2014/12/18 15:29:30 krw Exp $ */
+/* $OpenBSD: if.c,v 1.309 2014/12/19 17:14:39 tedu Exp $ */
/* $NetBSD: if.c,v 1.35 1996/05/07 05:26:04 thorpej Exp $ */
/*
#include <net/route.h>
#include <net/netisr.h>
-#ifdef INET
#include <netinet/in.h>
#include <netinet/if_ether.h>
#include <netinet/igmp.h>
#ifdef MROUTING
#include <netinet/ip_mroute.h>
#endif
-#endif
#ifdef INET6
-#ifndef INET
-#include <netinet/in.h>
-#endif
#include <netinet6/in6_var.h>
#include <netinet6/in6_ifattach.h>
#include <netinet6/nd6.h>
bpfdetach(ifp);
#endif
rt_if_remove(ifp);
-#ifdef INET
rti_delete(ifp);
#if NETHER > 0 && defined(NFSCLIENT)
if (ifp == revarp_ifp)
#ifdef MROUTING
vif_delete(ifp);
#endif
-#endif
-#ifdef INET
in_ifdetach(ifp);
-#endif
#ifdef INET6
in6_ifdetach(ifp);
#endif
extern struct ifqueue x; \
if_detach_queues(ifp, & x); \
} while (0)
-#ifdef INET
IF_DETACH_QUEUES(arpintrq);
IF_DETACH_QUEUES(ipintrq);
-#endif
#ifdef INET6
IF_DETACH_QUEUES(ip6intrq);
#endif
if (up)
if_down(ifp);
rt_if_remove(ifp);
-#ifdef INET
rti_delete(ifp);
#ifdef MROUTING
vif_delete(ifp);
#endif
-#endif
#ifdef INET6
in6_ifdetach(ifp);
#endif
-#ifdef INET
in_ifdetach(ifp);
-#endif
splx(s);
}
-/* $OpenBSD: if_bridge.c,v 1.229 2014/12/04 16:16:20 mikeb Exp $ */
+/* $OpenBSD: if_bridge.c,v 1.230 2014/12/19 17:14:39 tedu Exp $ */
/*
* Copyright (c) 1999, 2000 Jason L. Wright (jason@thought.net)
#include <net/if_llc.h>
#include <net/netisr.h>
-#ifdef INET
#include <netinet/in.h>
#include <netinet/ip.h>
#include <netinet/ip_var.h>
#include <netinet/if_ether.h>
#include <netinet/ip_icmp.h>
-#endif
#ifdef IPSEC
#include <netinet/ip_ipsp.h>
int bridge_ifenqueue(struct bridge_softc *, struct ifnet *, struct mbuf *);
void bridge_fragment(struct bridge_softc *, struct ifnet *,
struct ether_header *, struct mbuf *);
-#ifdef INET
void bridge_send_icmp_err(struct bridge_softc *, struct ifnet *,
struct ether_header *, struct mbuf *, int, struct llc *, int, int, int);
-#endif
#ifdef IPSEC
int bridge_ipsec(struct bridge_softc *, struct ifnet *,
struct ether_header *, int, struct llc *,
struct mbuf *m1;
u_int16_t etype;
-#ifdef INET
/*
* quick optimisation, don't send packets up the stack if no
* corresponding address has been specified.
if (ifa == NULL)
return;
}
-#endif
m1 = m_copym2(m, 0, M_COPYALL, M_DONTWAIT);
if (m1 == NULL) {
u_int16_t cpi;
int error, off, s;
u_int8_t proto = 0;
-#ifdef INET
struct ip *ip;
-#endif /* INET */
#ifdef INET6
struct ip6_hdr *ip6;
#endif /* INET6 */
if (dir == BRIDGE_IN) {
switch (af) {
-#ifdef INET
case AF_INET:
if (m->m_pkthdr.len - hlen < 2 * sizeof(u_int32_t))
break;
spi = ntohl(htons(cpi));
}
break;
-#endif /* INET */
#ifdef INET6
case AF_INET6:
if (m->m_pkthdr.len - hlen < 2 * sizeof(u_int32_t))
struct mbuf *m0;
int s, error = 0;
int hassnap = 0;
-#ifdef INET
u_int16_t etype;
struct ip *ip;
-#endif
-#ifndef INET
- goto dropit;
-#else
etype = ntohs(eh->ether_type);
#if NVLAN > 0
if ((m->m_flags & M_VLANTAG) || etype == ETHERTYPE_VLAN ||
ipstat.ips_fragmented++;
return;
-#endif /* INET */
dropit:
if (m != NULL)
m_freem(m);
return (0);
}
-#ifdef INET
void
bridge_send_icmp_err(struct bridge_softc *sc, struct ifnet *ifp,
struct ether_header *eh, struct mbuf *n, int hassnap, struct llc *llc,
dropit:
m_freem(n);
}
-#endif
struct sockaddr *
bridge_tunnel(struct mbuf *m)
-/* $OpenBSD: if_ethersubr.c,v 1.183 2014/12/08 10:46:14 mpi Exp $ */
+/* $OpenBSD: if_ethersubr.c,v 1.184 2014/12/19 17:14:39 tedu Exp $ */
/* $NetBSD: if_ethersubr.c,v 1.19 1996/05/07 02:40:30 thorpej Exp $ */
/*
}
switch (dst->sa_family) {
-#ifdef INET
case AF_INET:
if (!arpresolve(ac, rt, m, dst, edst))
return (0); /* if not yet resolved */
mcopy = m_copy(m, 0, (int)M_COPYALL);
etype = htons(ETHERTYPE_IP);
break;
-#endif
#ifdef INET6
case AF_INET6:
if (!nd6_storelladdr(ifp, rt, m, dst, (u_char *)edst))
decapsulate:
switch (etype) {
-#ifdef INET
case ETHERTYPE_IP:
schednetisr(NETISR_IP);
inq = &ipintrq;
revarpinput(m); /* XXX queue? */
goto done;
-#endif
#ifdef INET6
/*
* Schedule IPv6 software interrupt for incoming IPv6 packet.
return ether_crc32_be_update(0xffffffff, buf, len);
}
-#ifdef INET
u_char ether_ipmulticast_min[ETHER_ADDR_LEN] =
{ 0x01, 0x00, 0x5e, 0x00, 0x00, 0x00 };
u_char ether_ipmulticast_max[ETHER_ADDR_LEN] =
{ 0x01, 0x00, 0x5e, 0x7f, 0xff, 0xff };
-#endif
#ifdef INET6
u_char ether_ip6multicast_min[ETHER_ADDR_LEN] =
ether_multiaddr(struct sockaddr *sa, u_int8_t addrlo[ETHER_ADDR_LEN],
u_int8_t addrhi[ETHER_ADDR_LEN])
{
-#ifdef INET
struct sockaddr_in *sin;
-#endif /* INET */
#ifdef INET6
struct sockaddr_in6 *sin6;
#endif /* INET6 */
memcpy(addrhi, addrlo, ETHER_ADDR_LEN);
break;
-#ifdef INET
case AF_INET:
sin = satosin(sa);
if (sin->sin_addr.s_addr == INADDR_ANY) {
memcpy(addrhi, addrlo, ETHER_ADDR_LEN);
}
break;
-#endif
#ifdef INET6
case AF_INET6:
sin6 = satosin6(sa);
-/* $OpenBSD: if_gif.c,v 1.71 2014/12/05 15:50:04 mpi Exp $ */
+/* $OpenBSD: if_gif.c,v 1.72 2014/12/19 17:14:39 tedu Exp $ */
/* $KAME: if_gif.c,v 1.43 2001/02/20 08:51:07 itojun Exp $ */
/*
#include <net/route.h>
#include <net/bpf.h>
-#ifdef INET
#include <netinet/in.h>
#include <netinet/in_var.h>
#include <netinet/in_gif.h>
#include <netinet/ip.h>
#include <netinet/ip_ether.h>
#include <netinet/ip_var.h>
-#endif /* INET */
#ifdef INET6
-#ifndef INET
-#include <netinet/in.h>
-#endif
#include <netinet6/in6_var.h>
#include <netinet/ip6.h>
#include <netinet6/ip6_var.h>
*/
m->m_flags &= ~(M_BCAST|M_MCAST);
switch (sc->gif_psrc->sa_family) {
-#ifdef INET
case AF_INET:
error = in_gif_output(ifp, AF_LINK, &m);
break;
-#endif
#ifdef INET6
case AF_INET6:
error = in6_gif_output(ifp, AF_LINK, &m);
/* must decapsulate outer header for bpf */
switch (sc->gif_psrc->sa_family) {
-#ifdef INET
case AF_INET:
offset = sizeof(struct ip);
proto = mtod(m, struct ip *)->ip_p;
break;
-#endif
#ifdef INET6
case AF_INET6:
offset = sizeof(struct ip6_hdr);
/* XXX we should cache the outgoing route */
switch (sc->gif_psrc->sa_family) {
-#ifdef INET
case AF_INET:
ip_output(m, NULL, NULL, 0, NULL, NULL, 0);
break;
-#endif
#ifdef INET6
case AF_INET6:
/*
* Encapsulate packet. Add IP or IP6 header depending on tunnel AF.
*/
switch (sc->gif_psrc->sa_family) {
-#ifdef INET
case AF_INET:
error = in_gif_output(ifp, dst->sa_family, &m);
break;
-#endif
#ifdef INET6
case AF_INET6:
error = in6_gif_output(ifp, dst->sa_family, &m);
#endif /* INET6 */
case SIOCSLIFPHYADDR:
switch (cmd) {
-#ifdef INET
case SIOCSIFPHYADDR:
src = (struct sockaddr *)
&(((struct in_aliasreq *)data)->ifra_addr);
dst = (struct sockaddr *)
&(((struct in_aliasreq *)data)->ifra_dstaddr);
break;
-#endif
#ifdef INET6
case SIOCSIFPHYADDR_IN6:
src = (struct sockaddr *)
/* validate sa_len */
switch (src->sa_family) {
-#ifdef INET
case AF_INET:
if (src->sa_len != sizeof(struct sockaddr_in))
return (EINVAL);
break;
-#endif
#ifdef INET6
case AF_INET6:
if (src->sa_len != sizeof(struct sockaddr_in6))
return (EAFNOSUPPORT);
}
switch (dst->sa_family) {
-#ifdef INET
case AF_INET:
if (dst->sa_len != sizeof(struct sockaddr_in))
return (EINVAL);
break;
-#endif
#ifdef INET6
case AF_INET6:
if (dst->sa_len != sizeof(struct sockaddr_in6))
}
src = sc->gif_psrc;
switch (cmd) {
-#ifdef INET
case SIOCGIFPSRCADDR:
dst = &ifr->ifr_addr;
size = sizeof(ifr->ifr_addr);
break;
-#endif /* INET */
#ifdef INET6
case SIOCGIFPSRCADDR_IN6:
dst = (struct sockaddr *)
}
src = sc->gif_pdst;
switch (cmd) {
-#ifdef INET
case SIOCGIFPDSTADDR:
dst = &ifr->ifr_addr;
size = sizeof(ifr->ifr_addr);
break;
-#endif /* INET */
#ifdef INET6
case SIOCGIFPDSTADDR_IN6:
dst = (struct sockaddr *)
-/* $OpenBSD: if_gre.c,v 1.72 2014/11/23 07:39:02 deraadt Exp $ */
+/* $OpenBSD: if_gre.c,v 1.73 2014/12/19 17:14:39 tedu Exp $ */
/* $NetBSD: if_gre.c,v 1.9 1999/10/25 19:18:11 drochner Exp $ */
/*
#include <net/netisr.h>
#include <net/route.h>
-#ifdef INET
#include <netinet/in.h>
#include <netinet/ip.h>
#include <netinet/ip_var.h>
#include <netinet/if_ether.h>
-#else
-#error "if_gre used without inet"
-#endif
#if NBPFILTER > 0
#include <net/bpf.h>
-/* $OpenBSD: if_loop.c,v 1.61 2014/12/05 15:50:04 mpi Exp $ */
+/* $OpenBSD: if_loop.c,v 1.62 2014/12/19 17:14:39 tedu Exp $ */
/* $NetBSD: if_loop.c,v 1.15 1996/05/07 02:40:33 thorpej Exp $ */
/*
#include <net/netisr.h>
#include <net/route.h>
-#ifdef INET
#include <netinet/in.h>
#include <netinet/ip.h>
-#endif
#ifdef INET6
-#ifndef INET
-#include <netinet/in.h>
-#endif
#include <netinet/ip6.h>
#endif
ifp->if_obytes += m->m_pkthdr.len;
switch (dst->sa_family) {
-#ifdef INET
case AF_INET:
ifq = &ipintrq;
isr = NETISR_IP;
break;
-#endif
#ifdef INET6
case AF_INET6:
ifq = &ip6intrq;
-/* $OpenBSD: if_mpe.c,v 1.39 2014/12/05 15:50:04 mpi Exp $ */
+/* $OpenBSD: if_mpe.c,v 1.40 2014/12/19 17:14:39 tedu Exp $ */
/*
* Copyright (c) 2008 Pierre-Yves Ritschard <pyr@spootnik.org>
#include <net/netisr.h>
#include <net/route.h>
-#ifdef INET
#include <netinet/in.h>
#include <netinet/ip.h>
-#endif
#ifdef INET6
#include <netinet/ip6.h>
-#ifndef INET
-#include <netinet/in.h>
-#endif
#endif /* INET6 */
#include "bpfilter.h"
error = 0;
switch (dst->sa_family) {
-#ifdef INET
case AF_INET:
if (rt && rt->rt_flags & RTF_MPLS) {
shim.shim_label =
m_copyback(m, sizeof(sa_family_t), sizeof(in_addr_t),
(caddr_t)&((satosin(dst)->sin_addr)), M_NOWAIT);
break;
-#endif
default:
m_freem(m);
error = EPFNOSUPPORT;
-/* $OpenBSD: if_pflog.c,v 1.66 2014/12/05 15:50:04 mpi Exp $ */
+/* $OpenBSD: if_pflog.c,v 1.67 2014/12/19 17:14:39 tedu Exp $ */
/*
* The authors of this code are John Ioannidis (ji@tla.org),
* Angelos D. Keromytis (kermit@csd.uch.gr) and
#include <net/if_types.h>
#include <net/bpf.h>
-#ifdef INET
#include <netinet/in.h>
#include <netinet/ip.h>
#include <netinet/tcp.h>
#include <netinet/udp.h>
#include <netinet/ip_icmp.h>
-#endif
#ifdef INET6
-#ifndef INET
-#include <netinet/in.h>
-#endif
#include <netinet/ip6.h>
#include <netinet/icmp6.h>
#endif /* INET6 */
-/* $OpenBSD: if_pflow.c,v 1.48 2014/11/20 14:51:42 krw Exp $ */
+/* $OpenBSD: if_pflow.c,v 1.49 2014/12/19 17:14:39 tedu Exp $ */
/*
* Copyright (c) 2011 Florian Obser <florian@narrans.de>
#include <netinet/if_ether.h>
#include <netinet/tcp.h>
-#ifdef INET
#include <netinet/ip.h>
#include <netinet/ip_var.h>
#include <netinet/udp.h>
#include <netinet/udp_var.h>
#include <netinet/in_pcb.h>
-#endif /* INET */
#include <net/pfvar.h>
#include <net/if_pflow.h>
-/* $OpenBSD: if_pfsync.c,v 1.214 2014/12/17 09:57:13 mpi Exp $ */
+/* $OpenBSD: if_pfsync.c,v 1.215 2014/12/19 17:14:39 tedu Exp $ */
/*
* Copyright (c) 2002 Michael Shalayeff
#include <netinet/tcp.h>
#include <netinet/tcp_seq.h>
-#ifdef INET
#include <netinet/in_var.h>
#include <netinet/ip.h>
#include <netinet/ip_var.h>
-#endif
#ifdef INET6
#include <netinet6/in6_var.h>
else {
if (pd->pd_st->rule.ptr->rt == PF_ROUTETO) {
switch (pd->pd_st->key[PF_SK_WIRE]->af) {
-#ifdef INET
case AF_INET:
pf_route(&pd->pd_m, pd->pd_st->rule.ptr,
pd->pd_st->direction,
pd->pd_st->rt_kif->pfik_ifp, pd->pd_st);
break;
-#endif /* INET */
#ifdef INET6
case AF_INET6:
pf_route6(&pd->pd_m, pd->pd_st->rule.ptr,
}
} else {
switch (pd->pd_st->key[PF_SK_WIRE]->af) {
-#ifdef INET
case AF_INET:
ip_output(pd->pd_m, NULL, NULL, 0, NULL, NULL,
0);
break;
-#endif /* INET */
#ifdef INET6
case AF_INET6:
ip6_output(pd->pd_m, NULL, NULL, 0,
-/* $OpenBSD: if_ppp.c,v 1.79 2014/12/13 21:05:33 doug Exp $ */
+/* $OpenBSD: if_ppp.c,v 1.80 2014/12/19 17:14:39 tedu Exp $ */
/* $NetBSD: if_ppp.c,v 1.39 1997/05/17 21:11:59 christos Exp $ */
/*
#include <net/route.h>
#include <net/bpf.h>
-#ifdef INET
#include <netinet/in.h>
#include <netinet/ip.h>
-#else
-#ifdef _KERNEL
-#ifdef VJC
-#error ppp device with VJC assumes INET
-#endif
-#endif
-#endif
#include "bpfilter.h"
*/
m0->m_flags &= ~M_HIGHPRI;
switch (dst->sa_family) {
-#ifdef INET
case AF_INET:
address = PPP_ALLSTATIONS;
control = PPP_UI;
if (ip->ip_tos & IPTOS_LOWDELAY)
m0->m_flags |= M_HIGHPRI;
break;
-#endif
case AF_UNSPEC:
address = PPP_ADDRESS(dst->sa_data);
control = PPP_CONTROL(dst->sa_data);
rv = 0;
switch (proto) {
-#ifdef INET
case PPP_IP:
/*
* IP packet - take off the ppp header and pass it up to IP.
schednetisr(NETISR_IP);
inq = &ipintrq;
break;
-#endif
default:
/*
-/* $OpenBSD: if_pppx.c,v 1.34 2014/09/08 06:24:13 jsg Exp $ */
+/* $OpenBSD: if_pppx.c,v 1.35 2014/12/19 17:14:39 tedu Exp $ */
/*
* Copyright (c) 2010 Claudio Jeker <claudio@openbsd.org>
#include <netinet/if_ether.h>
#include <net/if_dl.h>
-#ifdef INET
#include <netinet/in_var.h>
#include <netinet/ip.h>
#include <netinet/ip_var.h>
-#endif
#ifdef INET6
#include <netinet6/in6_var.h>
m_adj(top, sizeof(struct pppx_hdr));
switch (ntohl(th->pppx_proto)) {
-#ifdef INET
case AF_INET:
ifq = &ipintrq;
isr = NETISR_IP;
break;
-#endif
#ifdef INET6
case AF_INET6:
ifq = &ip6intrq;
-/* $OpenBSD: if_spppsubr.c,v 1.128 2014/12/05 15:50:04 mpi Exp $ */
+/* $OpenBSD: if_spppsubr.c,v 1.129 2014/12/19 17:14:39 tedu Exp $ */
/*
* Synchronous PPP/Cisco link level subroutines.
* Keepalive protocol implemented in both Cisco and PPP modes.
#include <sys/stdarg.h>
-#ifdef INET
#include <netinet/in.h>
#include <netinet/in_var.h>
#include <netinet/ip.h>
#include <netinet/tcp.h>
#include <netinet/if_ether.h>
-#endif
#ifdef INET6
#include <netinet6/in6_ifattach.h>
static const struct cp ipcp = {
PPP_IPCP, IDX_IPCP,
-#ifdef INET /* don't run IPCP if there's no IPv4 support */
CP_NCP,
-#else
- 0,
-#endif
"ipcp",
sppp_ipcp_up, sppp_ipcp_down, sppp_ipcp_open, sppp_ipcp_close,
sppp_ipcp_TO, sppp_ipcp_RCR, sppp_ipcp_RCN_rej, sppp_ipcp_RCN_nak,
sppp_chap_input(sp, m);
m_freem (m);
return;
-#ifdef INET
case PPP_IPCP:
if (sp->pp_phase == PHASE_NETWORK)
sppp_cp_input(&ipcp, sp, m);
sp->pp_last_activity = tv.tv_sec;
}
break;
-#endif
#ifdef INET6
case PPP_IPV6CP:
if (sp->pp_phase == PHASE_NETWORK)
sppp_cisco_input ((struct sppp*) ifp, m);
m_freem (m);
return;
-#ifdef INET
case ETHERTYPE_IP:
schednetisr (NETISR_IP);
inq = &ipintrq;
break;
-#endif
#ifdef INET6
case ETHERTYPE_IPV6:
schednetisr (NETISR_IPV6);
s = splnet();
}
-#ifdef INET
/*
* Put low delay, telnet, rlogin and ftp control packets
* in front of the queue.
return (0);
}
}
-#endif
if (sp->pp_flags & PP_NOFRAMING)
goto skip_header;
skip_header:
switch (dst->sa_family) {
-#ifdef INET
case AF_INET: /* Internet Protocol */
if (sp->pp_flags & PP_CISCO)
protocol = htons (ETHERTYPE_IP);
rv = ENETDOWN;
}
break;
-#endif
#ifdef INET6
case AF_INET6: /* Internet Protocol v6 */
if (sp->pp_flags & PP_CISCO)
-/* $OpenBSD: if_trunk.c,v 1.93 2014/12/04 00:01:53 tedu Exp $ */
+/* $OpenBSD: if_trunk.c,v 1.94 2014/12/19 17:14:39 tedu Exp $ */
/*
* Copyright (c) 2005, 2006, 2007 Reyk Floeter <reyk@openbsd.org>
#include <net/bpf.h>
#endif
-#ifdef INET
#include <netinet/in.h>
#include <netinet/if_ether.h>
#include <netinet/ip.h>
-#endif
#ifdef INET6
#include <netinet/ip6.h>
break;
case SIOCSIFADDR:
ifp->if_flags |= IFF_UP;
-#ifdef INET
if (ifa->ifa_addr->sa_family == AF_INET)
arp_ifinit(&tr->tr_ac, ifa);
-#endif /* INET */
error = ENETRESET;
break;
case SIOCSIFFLAGS:
u_int16_t *vlan, vlanbuf[2];
int off;
struct ether_header *eh;
-#ifdef INET
struct ip *ip, ipbuf;
-#endif
#ifdef INET6
u_int32_t flow;
struct ip6_hdr *ip6, ip6buf;
}
switch (etype) {
-#ifdef INET
case ETHERTYPE_IP:
if ((ip = (struct ip *)
trunk_gethdr(m, off, sizeof(*ip), &ipbuf)) == NULL)
SipHash24_Update(&ctx, &ip->ip_src, sizeof(struct in_addr));
SipHash24_Update(&ctx, &ip->ip_dst, sizeof(struct in_addr));
break;
-#endif
#ifdef INET6
case ETHERTYPE_IPV6:
if ((ip6 = (struct ip6_hdr *)
-/* $OpenBSD: if_tun.c,v 1.129 2014/10/21 10:52:53 yasuoka Exp $ */
+/* $OpenBSD: if_tun.c,v 1.130 2014/12/19 17:14:40 tedu Exp $ */
/* $NetBSD: if_tun.c,v 1.24 1996/05/07 02:40:48 thorpej Exp $ */
/*
#include <net/if_types.h>
#include <net/netisr.h>
-#ifdef INET
#include <netinet/in.h>
#include <netinet/ip.h>
#include <netinet/if_ether.h>
-#endif
#ifdef PIPEX
#include <net/pipex.h>
tp->tun_flags &= ~(TUN_IASET|TUN_DSTADDR|TUN_BRDADDR);
TAILQ_FOREACH(ifa, &ifp->if_addrlist, ifa_list) {
-#ifdef INET
if (ifa->ifa_addr->sa_family == AF_INET) {
struct sockaddr_in *sin;
} else
tp->tun_flags &= ~TUN_BRDADDR;
}
-#endif
#ifdef INET6
if (ifa->ifa_addr->sa_family == AF_INET6) {
struct sockaddr_in6 *sin;
TUNDEBUG(("%s: address set\n", ifp->if_xname));
if (tp->tun_flags & TUN_LAYER2) {
switch (ifa->ifa_addr->sa_family) {
-#ifdef INET
case AF_INET:
arp_ifinit(&tp->arpcom, ifa);
break;
-#endif
default:
break;
}
top->m_pkthdr.ph_rtableid = ifp->if_rdomain;
switch (ntohl(*th)) {
-#ifdef INET
case AF_INET:
ifq = &ipintrq;
isr = NETISR_IP;
break;
-#endif
#ifdef INET6
case AF_INET6:
ifq = &ip6intrq;
-/* $OpenBSD: if_vether.c,v 1.21 2014/11/23 07:39:02 deraadt Exp $ */
+/* $OpenBSD: if_vether.c,v 1.22 2014/12/19 17:14:40 tedu Exp $ */
/*
* Copyright (c) 2009 Theo de Raadt
#include <net/if_dl.h>
#include <net/if_media.h>
-#ifdef INET
#include <netinet/in.h>
#include <netinet/if_ether.h>
-#endif
void vetherattach(int);
int vetherioctl(struct ifnet *, u_long, caddr_t);
vetherioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
{
struct vether_softc *sc = (struct vether_softc *)ifp->if_softc;
-#ifdef INET
struct ifaddr *ifa = (struct ifaddr *)data;
-#endif
struct ifreq *ifr = (struct ifreq *)data;
int error = 0, link_state;
switch (cmd) {
case SIOCSIFADDR:
ifp->if_flags |= IFF_UP;
-#ifdef INET
if (ifa->ifa_addr->sa_family == AF_INET)
arp_ifinit(&sc->sc_ac, ifa);
-#endif
/* FALLTHROUGH */
case SIOCSIFFLAGS:
-/* $OpenBSD: if_vlan.c,v 1.110 2014/11/23 07:39:02 deraadt Exp $ */
+/* $OpenBSD: if_vlan.c,v 1.111 2014/12/19 17:14:40 tedu Exp $ */
/*
* Copyright 1998 Massachusetts Institute of Technology
#include <net/if_dl.h>
#include <net/if_types.h>
-#ifdef INET
#include <netinet/in.h>
#include <netinet/if_ether.h>
-#endif
#include <net/if_vlan_var.h>
case SIOCSIFADDR:
if (ifv->ifv_p != NULL) {
ifp->if_flags |= IFF_UP;
-#ifdef INET
if (ifa->ifa_addr->sa_family == AF_INET)
arp_ifinit(&ifv->ifv_ac, ifa);
-#endif
} else
error = EINVAL;
break;
-/* $OpenBSD: if_vxlan.c,v 1.19 2014/12/17 09:57:13 mpi Exp $ */
+/* $OpenBSD: if_vxlan.c,v 1.20 2014/12/19 17:14:40 tedu Exp $ */
/*
* Copyright (c) 2013 Reyk Floeter <reyk@openbsd.org>
* at least 1550 bytes. The following is disabled by default.
*/
ifp->if_mtu = ETHERMTU - sizeof(struct ether_header);
-#ifdef INET
ifp->if_mtu -= sizeof(struct vxlanudpiphdr);
-#endif
#endif
LIST_INSERT_HEAD(&vxlan_tagh[VXLAN_TAGHASH(0)], sc, sc_entry);
vxlan_config(struct ifnet *ifp, struct sockaddr *src, struct sockaddr *dst)
{
struct vxlan_softc *sc = (struct vxlan_softc *)ifp->if_softc;
-#ifdef INET
struct sockaddr_in *src4, *dst4;
-#endif
int reset = 0, error;
if (src != NULL && dst != NULL) {
reset = 1;
}
-#ifdef INET
src4 = satosin(src);
dst4 = satosin(dst);
if (src4->sin_len != sizeof(*src4) || dst4->sin_len != sizeof(*dst4))
return (EINVAL);
-#endif
vxlan_multicast_cleanup(ifp);
-#ifdef INET
if (IN_MULTICAST(dst4->sin_addr.s_addr)) {
if ((error = vxlan_multicast_join(ifp, src4, dst4)) != 0)
return (error);
}
if (dst4->sin_port)
sc->sc_dstport = dst4->sin_port;
-#endif
if (!reset) {
bzero(&sc->sc_src, sizeof(sc->sc_src));
vxlanioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
{
struct vxlan_softc *sc = (struct vxlan_softc *)ifp->if_softc;
-#ifdef INET
struct ifaddr *ifa = (struct ifaddr *)data;
-#endif
struct ifreq *ifr = (struct ifreq *)data;
struct if_laddrreq *lifr = (struct if_laddrreq *)data;
struct proc *p = curproc;
switch (cmd) {
case SIOCSIFADDR:
ifp->if_flags |= IFF_UP;
-#ifdef INET
if (ifa->ifa_addr->sa_family == AF_INET)
arp_ifinit(&sc->sc_ac, ifa);
-#endif
/* FALLTHROUGH */
case SIOCSIFFLAGS:
vxlan_output(struct ifnet *ifp, struct mbuf *m)
{
struct vxlan_softc *sc = (struct vxlan_softc *)ifp->if_softc;
-#ifdef INET
struct udpiphdr *ui;
struct vxlanudpiphdr *vi;
u_int16_t len = m->m_pkthdr.len;
struct ip *ip;
#if NBRIDGE > 0
struct sockaddr_in *sin;
-#endif
#endif
int error;
-#ifdef INET
/* VXLAN header */
M_PREPEND(m, sizeof(*vi), M_DONTWAIT);
if (m == NULL) {
/* UDP checksum should be 0 */
ui->ui_sum = 0;
-#endif
ifp->if_opackets++;
ifp->if_obytes += m->m_pkthdr.len;
pf_pkt_addr_changed(m);
#endif
-#ifdef INET
if ((error =
ip_output(m, NULL, NULL, IP_RAWOUTPUT, &sc->sc_imo, NULL, 0))) {
ifp->if_oerrors++;
}
-#endif
return (error);
}
-/* $OpenBSD: if_vxlan.h,v 1.5 2014/04/11 08:44:37 mpi Exp $ */
+/* $OpenBSD: if_vxlan.h,v 1.6 2014/12/19 17:14:40 tedu Exp $ */
/*
* Copyright (c) 2013 Reyk Floeter <reyk@openbsd.org>
#define VXLAN_RESERVED2 0x000000ff
} __packed;
-#ifdef INET
struct vxlanudpiphdr {
struct ipovly ui_i;
struct udphdr ui_u;
struct vxlan_header ui_v;
} __packed;
-#endif
#ifdef _KERNEL
struct vxlan_softc {
while ((n = netisr) != 0) {
atomic_clearbits_int(&netisr, n);
-#ifdef INET
#if NETHER > 0
if (n & (1 << NETISR_ARP))
arpintr();
#endif
if (n & (1 << NETISR_IP))
ipintr();
-#endif
#ifdef INET6
if (n & (1 << NETISR_IPV6))
ip6intr();
-/* $OpenBSD: pf.c,v 1.897 2014/12/11 08:45:44 mpi Exp $ */
+/* $OpenBSD: pf.c,v 1.898 2014/12/19 17:14:40 tedu Exp $ */
/*
* Copyright (c) 2001 Daniel Hartmeier
pf_addr_compare(struct pf_addr *a, struct pf_addr *b, sa_family_t af)
{
switch (af) {
-#ifdef INET
case AF_INET:
if (a->addr32[0] > b->addr32[0])
return (1);
if (a->addr32[0] < b->addr32[0])
return (-1);
break;
-#endif /* INET */
#ifdef INET6
case AF_INET6:
if (a->addr32[3] > b->addr32[3])
pf_addrcpy(struct pf_addr *dst, struct pf_addr *src, sa_family_t af)
{
switch (af) {
-#ifdef INET
case AF_INET:
dst->addr32[0] = src->addr32[0];
break;
-#endif /* INET */
case AF_INET6:
dst->addr32[0] = src->addr32[0];
dst->addr32[1] = src->addr32[1];
bzero(&p, sizeof(p));
p.pfra_af = (*state)->key[PF_SK_WIRE]->af;
switch ((*state)->key[PF_SK_WIRE]->af) {
-#ifdef INET
case AF_INET:
p.pfra_net = 32;
p.pfra_ip4addr = sn->addr.v4;
break;
-#endif /* INET */
#ifdef INET6
case AF_INET6:
p.pfra_net = 128;
pf_print_host(struct pf_addr *addr, u_int16_t p, sa_family_t af)
{
switch (af) {
-#ifdef INET
case AF_INET: {
u_int32_t a = ntohl(addr->addr32[0]);
addlog("%u.%u.%u.%u", (a>>24)&255, (a>>16)&255,
}
break;
}
-#endif /* INET */
#ifdef INET6
case AF_INET6: {
u_int16_t b;
/* Queries (and responses) */
switch (pd->af) {
-#ifdef INET
case AF_INET:
switch (type) {
case ICMP_ECHO:
break;
}
break;
-#endif /* INET */
#ifdef INET6
case AF_INET6:
switch (type) {
{
struct mbuf *m;
int len, tlen;
-#ifdef INET
struct ip *h;
-#endif /* INET */
#ifdef INET6
struct ip6_hdr *h6;
#endif /* INET6 */
tlen += 4;
switch (af) {
-#ifdef INET
case AF_INET:
len = sizeof(struct ip) + tlen;
break;
-#endif /* INET */
#ifdef INET6
case AF_INET6:
len = sizeof(struct ip6_hdr) + tlen;
m->m_pkthdr.csum_flags |= M_TCP_CSUM_OUT;
bzero(m->m_data, len);
switch (af) {
-#ifdef INET
case AF_INET:
h = mtod(m, struct ip *);
h->ip_p = IPPROTO_TCP;
th = (struct tcphdr *)((caddr_t)h + sizeof(struct ip));
break;
-#endif /* INET */
#ifdef INET6
case AF_INET6:
h6 = mtod(m, struct ip6_hdr *);
}
switch (af) {
-#ifdef INET
case AF_INET:
if (eh == NULL) {
ip_output(m, NULL, NULL, 0, NULL, NULL, 0);
ip_output(m, NULL, &ro, IP_ROUTETOETHER, NULL, NULL, 0);
}
break;
-#endif /* INET */
#ifdef INET6
case AF_INET6:
ip6_output(m, NULL, NULL, 0, NULL, NULL, NULL);
m0->m_pkthdr.pf.qid = r->qid;
switch (af) {
-#ifdef INET
case AF_INET:
icmp_error(m0, type, code, 0, 0);
break;
-#endif /* INET */
#ifdef INET6
case AF_INET6:
icmp6_error(m0, type, code, 0);
int match = 0;
switch (af) {
-#ifdef INET
case AF_INET:
if ((a->addr32[0] & m->addr32[0]) ==
(b->addr32[0] & m->addr32[0]))
match++;
break;
-#endif /* INET */
#ifdef INET6
case AF_INET6:
if (((a->addr32[0] & m->addr32[0]) ==
struct pf_addr *a, sa_family_t af)
{
switch (af) {
-#ifdef INET
case AF_INET:
if ((ntohl(a->addr32[0]) < ntohl(b->addr32[0])) ||
(ntohl(a->addr32[0]) > ntohl(e->addr32[0])))
return (0);
break;
-#endif /* INET */
#ifdef INET6
case AF_INET6: {
int i;
struct pf_addr *rmask, struct pf_addr *saddr, sa_family_t af)
{
switch (af) {
-#ifdef INET
case AF_INET:
naddr->addr32[0] = (raddr->addr32[0] & rmask->addr32[0]) |
((rmask->addr32[0] ^ 0xffffffff ) & saddr->addr32[0]);
break;
-#endif /* INET */
case AF_INET6:
naddr->addr32[0] = (raddr->addr32[0] & rmask->addr32[0]) |
((rmask->addr32[0] ^ 0xffffffff ) & saddr->addr32[0]);
pf_addr_inc(struct pf_addr *addr, sa_family_t af)
{
switch (af) {
-#ifdef INET
case AF_INET:
addr->addr32[0] = htonl(ntohl(addr->addr32[0]) + 1);
break;
-#endif /* INET */
case AF_INET6:
if (addr->addr32[3] == 0xffffffff) {
addr->addr32[3] = 0;
daddr = pd->src;
}
switch (pd->af) {
-#ifdef INET
case AF_INET:
/*
* Fails when rtable is changed while evaluating the ruleset
return (-1);
}
break;
-#endif /* INET */
#ifdef INET6
case AF_INET6:
inp = in6_pcbhashlookup(tb, &saddr->v6, sport, &daddr->v6,
u_int16_t
pf_calc_mss(struct pf_addr *addr, sa_family_t af, int rtableid, u_int16_t offer)
{
-#ifdef INET
struct sockaddr_in *dst;
-#endif /* INET */
#ifdef INET6
struct sockaddr_in6 *dst6;
#endif /* INET6 */
memset(&ss, 0, sizeof(ss));
switch (af) {
-#ifdef INET
case AF_INET:
hlen = sizeof(struct ip);
dst = (struct sockaddr_in *)&ss;
dst->sin_addr = addr->v4;
rt = rtalloc(sintosa(dst), RT_REPORT, rtableid);
break;
-#endif /* INET */
#ifdef INET6
case AF_INET6:
hlen = sizeof(struct ip6_hdr);
return;
bzero(sns, sizeof(sns));
switch (s->key[PF_SK_WIRE]->af) {
-#ifdef INET
case AF_INET:
pf_map_addr(AF_INET, r, saddr, &s->rt_addr, NULL, sns,
&r->route, PF_SN_ROUTE);
s->rt_kif = r->route.kif;
s->natrule.ptr = r;
break;
-#endif /* INET */
#ifdef INET6
case AF_INET6:
pf_map_addr(AF_INET6, r, saddr, &s->rt_addr, NULL, sns,
SHA512Update(&ctx, &pd->hdr.tcp->th_sport, sizeof(u_short));
SHA512Update(&ctx, &pd->hdr.tcp->th_dport, sizeof(u_short));
switch (pd->af) {
-#ifdef INET
case AF_INET:
SHA512Update(&ctx, &pd->src->v4, sizeof(struct in_addr));
SHA512Update(&ctx, &pd->dst->v4, sizeof(struct in_addr));
break;
-#endif /* INET */
#ifdef INET6
case AF_INET6:
SHA512Update(&ctx, &pd->src->v6, sizeof(struct in6_addr));
}
switch (pd->virtual_proto) {
-#ifdef INET
case IPPROTO_ICMP:
icmptype = pd->hdr.icmp->icmp_type;
icmpcode = pd->hdr.icmp->icmp_code;
pd->odport = pd->ndport = virtual_id;
}
break;
-#endif /* INET */
#ifdef INET6
case IPPROTO_ICMPV6:
icmptype = pd->hdr.icmp6->icmp6_type;
}
break;
-#ifdef INET
case IPPROTO_ICMP:
/* pf_translate() is also used when logging invalid packets */
if (pd->af != AF_INET)
}
}
break;
-#endif /* INET */
#ifdef INET6
case IPPROTO_ICMPV6:
return (0);
if (afto) {
-#ifdef INET
/* ip_sum will be recalculated in pf_translate_af */
if (pf_translate_icmp_af(AF_INET, pd->hdr.icmp6))
return (0);
pd->proto = IPPROTO_ICMP;
rewrite = 1;
-#endif /* INET */
} else {
if (PF_ANEQ(saddr, pd->src, pd->af)) {
pf_change_a6(pd, pd->src, saddr);
default:
switch (pd->af) {
-#ifdef INET
case AF_INET:
if (!afto && PF_ANEQ(saddr, pd->src, pd->af)) {
pf_change_a(pd, &pd->src->v4.s_addr,
rewrite = 1;
}
break;
-#endif /* INET */
#ifdef INET6
case AF_INET6:
if (!afto && PF_ANEQ(saddr, pd->src, pd->af)) {
struct pf_state_key_cmp key;
switch (pd->proto) {
-#ifdef INET
case IPPROTO_ICMP:
icmptype = pd->hdr.icmp->icmp_type;
break;
-#endif /* INET */
#ifdef INET6
case IPPROTO_ICMPV6:
icmptype = pd->hdr.icmp6->icmp6_type;
pd->m->m_pkthdr.ph_rtableid = nk->rdomain;
switch (pd->af) {
-#ifdef INET
case AF_INET:
#ifdef INET6
if (afto) {
pd->hdr.icmp, M_NOWAIT);
copyback = 1;
break;
-#endif /* INET */
#ifdef INET6
case AF_INET6:
-#ifdef INET
if (afto) {
if (pf_translate_icmp_af(AF_INET,
pd->hdr.icmp6))
return (PF_DROP);
pd->proto = IPPROTO_ICMP;
}
-#endif /* INET */
if (!afto && PF_ANEQ(pd->src,
&nk->addr[sidx], AF_INET6))
pf_change_a6(pd, saddr,
* Extract the inner TCP/UDP header and search for that state.
*/
struct pf_pdesc pd2;
-#ifdef INET
struct ip h2;
-#endif /* INET */
#ifdef INET6
struct ip6_hdr h2_6;
#endif /* INET6 */
pd2.sidx = (pd2.dir == PF_IN) ? 1 : 0;
pd2.didx = (pd2.dir == PF_IN) ? 0 : 1;
switch (pd->af) {
-#ifdef INET
case AF_INET:
/* offset of h2 in mbuf chain */
ipoff2 = pd->off + ICMP_MINLEN;
pd2.src = (struct pf_addr *)&h2.ip_src;
pd2.dst = (struct pf_addr *)&h2.ip_dst;
break;
-#endif /* INET */
#ifdef INET6
case AF_INET6:
ipoff2 = pd->off + sizeof(struct icmp6_hdr);
if (copyback) {
switch (pd2.af) {
-#ifdef INET
case AF_INET:
m_copyback(pd->m, pd->off, ICMP_MINLEN,
pd->hdr.icmp, M_NOWAIT);
m_copyback(pd2.m, ipoff2, sizeof(h2),
&h2, M_NOWAIT);
break;
-#endif /* INET */
#ifdef INET6
case AF_INET6:
m_copyback(pd->m, pd->off,
nk->port[pd2.didx], pd2.af);
switch (pd2.af) {
-#ifdef INET
case AF_INET:
m_copyback(pd->m, pd->off, ICMP_MINLEN,
pd->hdr.icmp, M_NOWAIT);
m_copyback(pd2.m, ipoff2, sizeof(h2),
&h2, M_NOWAIT);
break;
-#endif /* INET */
#ifdef INET6
case AF_INET6:
m_copyback(pd->m, pd->off,
}
break;
}
-#ifdef INET
case IPPROTO_ICMP: {
struct icmp iih;
}
break;
}
-#endif /* INET */
#ifdef INET6
case IPPROTO_ICMPV6: {
struct icmp6_hdr iih;
didx = afto ? pd2.sidx : pd2.didx;
iidx = afto ? !iidx : iidx;
-#ifdef INET
if (afto) {
if (nk->af != AF_INET)
return (PF_DROP);
pd->naf = nk->af;
return (PF_AFRT);
}
-#endif /* INET */
if (PF_ANEQ(pd2.src,
&nk->addr[pd2.sidx], pd2.af) ||
pd2.af);
switch (pd2.af) {
-#ifdef INET
case AF_INET:
m_copyback(pd->m, pd->off, ICMP_MINLEN,
pd->hdr.icmp, M_NOWAIT);
m_copyback(pd2.m, ipoff2, sizeof(h2),
&h2, M_NOWAIT);
break;
-#endif /* INET */
#ifdef INET6
case AF_INET6:
m_copyback(pd->m, pd->off,
u_short *actionp, u_short *reasonp, sa_family_t af)
{
switch (af) {
-#ifdef INET
case AF_INET: {
struct ip *h = mtod(m, struct ip *);
u_int16_t fragoff = (ntohs(h->ip_off) & IP_OFFMASK) << 3;
}
break;
}
-#endif /* INET */
#ifdef INET6
case AF_INET6: {
struct ip6_hdr *h = mtod(m, struct ip6_hdr *);
check_mpath = 0;
memset(&ss, 0, sizeof(ss));
switch (af) {
-#ifdef INET
case AF_INET:
dst = (struct sockaddr_in *)&ss;
dst->sin_family = AF_INET;
if (ipmultipath)
check_mpath = 1;
break;
-#endif /* INET */
#ifdef INET6
case AF_INET6:
/*
memset(&ss, 0, sizeof(ss));
switch (af) {
-#ifdef INET
case AF_INET:
dst = (struct sockaddr_in *)&ss;
dst->sin_family = AF_INET;
dst->sin_len = sizeof(*dst);
dst->sin_addr = addr->v4;
break;
-#endif /* INET */
#ifdef INET6
case AF_INET6:
dst6 = (struct sockaddr_in6 *)&ss;
return (ret);
}
-#ifdef INET
void
pf_route(struct mbuf **m, struct pf_rule *r, int dir, struct ifnet *oifp,
struct pf_state *s)
m_freem(m0);
goto done;
}
-#endif /* INET */
#ifdef INET6
void
udpstat.udps_inswcsum++;
switch (af) {
-#ifdef INET
case AF_INET:
if (pd->m->m_len < sizeof(struct ip)) {
pd->csum_status = PF_CSUM_BAD;
}
sum = in4_cksum(pd->m, (p == IPPROTO_ICMP ? 0 : p), off, len);
break;
-#endif /* INET */
#ifdef INET6
case AF_INET6:
if (pd->m->m_len < sizeof(struct ip6_hdr)) {
pd->rdomain = rtable_l2(pd->m->m_pkthdr.ph_rtableid);
switch (pd->af) {
-#ifdef INET
case AF_INET: {
struct ip *h;
break;
}
-#endif /* INET */
#ifdef INET6
case AF_INET6: {
struct ip6_hdr *h;
/* packet normalization and reassembly */
switch (pd.af) {
-#ifdef INET
case AF_INET:
action = pf_normalize_ip(&pd, &reason);
break;
-#endif
#ifdef INET6
case AF_INET6:
action = pf_normalize_ip6(&pd, &reason);
-/* $OpenBSD: pf_if.c,v 1.76 2014/12/05 15:50:04 mpi Exp $ */
+/* $OpenBSD: pf_if.c,v 1.77 2014/12/19 17:14:40 tedu Exp $ */
/*
* Copyright 2005 Henning Brauer <henning@openbsd.org>
pfi_match_addr(struct pfi_dynaddr *dyn, struct pf_addr *a, sa_family_t af)
{
switch (af) {
-#ifdef INET
case AF_INET:
switch (dyn->pfid_acnt4) {
case 0:
return (pfr_match_addr(dyn->pfid_kt, a, AF_INET));
}
break;
-#endif /* INET */
#ifdef INET6
case AF_INET6:
switch (dyn->pfid_acnt6) {
-/* $OpenBSD: pf_ioctl.c,v 1.279 2014/12/09 07:05:06 doug Exp $ */
+/* $OpenBSD: pf_ioctl.c,v 1.280 2014/12/19 17:14:40 tedu Exp $ */
/*
* Copyright (c) 2001 Daniel Hartmeier
switch (rule->af) {
case 0:
break;
-#ifdef INET
case AF_INET:
break;
-#endif /* INET */
#ifdef INET6
case AF_INET6:
break;
switch (newrule->af) {
case 0:
break;
-#ifdef INET
case AF_INET:
break;
-#endif /* INET */
#ifdef INET6
case AF_INET6:
break;
-/* $OpenBSD: pf_lb.c,v 1.39 2014/12/19 13:04:08 reyk Exp $ */
+/* $OpenBSD: pf_lb.c,v 1.40 2014/12/19 17:14:40 tedu Exp $ */
/*
* Copyright (c) 2001 Daniel Hartmeier
#endif
switch (af) {
-#ifdef INET
case AF_INET:
res = SipHash24((SIPHASH_KEY *)key,
&inaddr->addr32[0], sizeof(inaddr->addr32[0]));
hash->addr32[0] = res;
break;
-#endif /* INET */
#ifdef INET6
case AF_INET6:
res = SipHash24((SIPHASH_KEY *)key, &inaddr->addr32[0],
return (1);
if (rpool->addr.type == PF_ADDR_DYNIFTL) {
switch (af) {
-#ifdef INET
case AF_INET:
if (rpool->addr.p.dyn->pfid_acnt4 < 1 &&
!PF_POOL_DYNTYPE(rpool->opts))
raddr = &rpool->addr.p.dyn->pfid_addr4;
rmask = &rpool->addr.p.dyn->pfid_mask4;
break;
-#endif /* INET */
#ifdef INET6
case AF_INET6:
if (rpool->addr.p.dyn->pfid_acnt6 < 1 &&
PF_ACPY(naddr, &rpool->counter, af);
} else if (init_addr != NULL && PF_AZERO(init_addr, af)) {
switch (af) {
-#ifdef INET
case AF_INET:
rpool->counter.addr32[0] = htonl(arc4random());
break;
-#endif /* INET */
#ifdef INET6
case AF_INET6:
if (rmask->addr32[3] != 0xffffffff)
-/* $OpenBSD: pf_norm.c,v 1.171 2014/12/05 15:50:04 mpi Exp $ */
+/* $OpenBSD: pf_norm.c,v 1.172 2014/12/19 17:14:40 tedu Exp $ */
/*
* Copyright 2001 Niels Provos <provos@citi.umich.edu>
bzero(src->scrub, sizeof(*src->scrub));
switch (pd->af) {
-#ifdef INET
case AF_INET: {
struct ip *h = mtod(pd->m, struct ip *);
src->scrub->pfss_ttl = h->ip_ttl;
break;
}
-#endif /* INET */
#ifdef INET6
case AF_INET6: {
struct ip6_hdr *h = mtod(pd->m, struct ip6_hdr *);
* firewall state code.
*/
switch (pd->af) {
-#ifdef INET
case AF_INET: {
if (src->scrub) {
struct ip *h = mtod(pd->m, struct ip *);
}
break;
}
-#endif /* INET */
#ifdef INET6
case AF_INET6: {
if (src->scrub) {
-/* $OpenBSD: pf_table.c,v 1.103 2014/09/08 06:24:13 jsg Exp $ */
+/* $OpenBSD: pf_table.c,v 1.104 2014/12/19 17:14:40 tedu Exp $ */
/*
* Copyright (c) 2002 Cedric Berger
int i;
switch (ad->pfra_af) {
-#ifdef INET
case AF_INET:
if (ad->pfra_net > 32)
return (-1);
break;
-#endif /* INET */
#ifdef INET6
case AF_INET6:
if (ad->pfra_net > 128)
return (0);
switch (af) {
-#ifdef INET
case AF_INET:
pfr_sin.sin_addr.s_addr = a->addr32[0];
ke = (struct pfr_kentry *)rn_match(&pfr_sin, kt->pfrkt_ip4);
if (ke && KENTRY_RNF_ROOT(ke))
ke = NULL;
break;
-#endif /* INET */
#ifdef INET6
case AF_INET6:
bcopy(a, &pfr_sin6.sin6_addr, sizeof(pfr_sin6.sin6_addr));
return;
switch (af) {
-#ifdef INET
case AF_INET:
pfr_sin.sin_addr.s_addr = a->addr32[0];
ke = (struct pfr_kentry *)rn_match(&pfr_sin, kt->pfrkt_ip4);
if (ke && KENTRY_RNF_ROOT(ke))
ke = NULL;
break;
-#endif /* INET */
#ifdef INET6
case AF_INET6:
bcopy(a, &pfr_sin6.sin6_addr, sizeof(pfr_sin6.sin6_addr));
w.pfrw_cnt = idx;
switch (af) {
-#ifdef INET
case AF_INET:
rn_walktree(kt->pfrkt_ip4, pfr_walktree, &w);
return (w.pfrw_kentry);
-#endif /* INET */
#ifdef INET6
case AF_INET6:
rn_walktree(kt->pfrkt_ip6, pfr_walktree, &w);
bzero(&p, sizeof(p));
p.pfra_af = af;
switch (af) {
-#ifdef INET
case AF_INET:
p.pfra_net = 32;
p.pfra_ip4addr = addr->v4;
break;
-#endif /* INET */
#ifdef INET6
case AF_INET6:
p.pfra_net = 128;
-/* $OpenBSD: pfkeyv2.c,v 1.137 2014/11/25 13:10:03 mpi Exp $ */
+/* $OpenBSD: pfkeyv2.c,v 1.138 2014/12/19 17:14:40 tedu Exp $ */
/*
* @(#)COPYRIGHT 1.1 (NRL) 17 January 1995
bzero(&sunion, sizeof(union sockaddr_union));
switch (ipa->ipa_info.sen_type) {
-#ifdef INET
case SENT_IP4:
i += 4 * PADUP(sizeof(struct sockaddr_in));
sunion.sa.sa_family = AF_INET;
sunion.sa.sa_len = sizeof(struct sockaddr_in);
dir = ipa->ipa_info.sen_direction;
break;
-#endif /* INET */
#ifdef INET6
case SENT_IP6:
else
headers[SADB_X_EXT_DST_FLOW] = p;
switch (sunion.sa.sa_family) {
-#ifdef INET
case AF_INET:
sunion.sin.sin_addr = ipa->ipa_info.sen_ip_src;
sunion.sin.sin_port = ipa->ipa_info.sen_sport;
break;
-#endif /* INET */
#ifdef INET6
case AF_INET6:
else
headers[SADB_X_EXT_DST_MASK] = p;
switch (sunion.sa.sa_family) {
-#ifdef INET
case AF_INET:
sunion.sin.sin_addr = ipa->ipa_mask.sen_ip_src;
sunion.sin.sin_port = ipa->ipa_mask.sen_sport;
break;
-#endif /* INET */
#ifdef INET6
case AF_INET6:
else
headers[SADB_X_EXT_SRC_FLOW] = p;
switch (sunion.sa.sa_family) {
-#ifdef INET
case AF_INET:
sunion.sin.sin_addr = ipa->ipa_info.sen_ip_dst;
sunion.sin.sin_port = ipa->ipa_info.sen_dport;
break;
-#endif /* INET */
#ifdef INET6
case AF_INET6:
else
headers[SADB_X_EXT_SRC_MASK] = p;
switch (sunion.sa.sa_family) {
-#ifdef INET
case AF_INET:
sunion.sin.sin_addr = ipa->ipa_mask.sen_ip_dst;
sunion.sin.sin_port = ipa->ipa_mask.sen_dport;
break;
-#endif /* INET */
#ifdef INET6
case AF_INET6:
sp->sadb_protocol_len = sizeof(struct sadb_protocol) /
sizeof(u_int64_t);
switch (sunion.sa.sa_family) {
-#ifdef INET
case AF_INET:
if (ipa->ipa_mask.sen_proto)
sp->sadb_protocol_proto = ipa->ipa_info.sen_proto;
sp->sadb_protocol_direction = ipa->ipa_info.sen_direction;
break;
-#endif /* INET */
#ifdef INET6
case AF_INET6:
/* We'll need four of them: src, src mask, dst, dst mask. */
switch (sa->tdb_filter.sen_type) {
-#ifdef INET
case SENT_IP4:
i += 4 * PADUP(sizeof(struct sockaddr_in));
i += 4 * sizeof(struct sadb_address);
break;
-#endif /* INET */
#ifdef INET6
case SENT_IP6:
i += 4 * PADUP(sizeof(struct sockaddr_in6));
/* We'll need four of them: src, src mask, dst, dst mask. */
switch (ipo->ipo_addr.sen_type) {
-#ifdef INET
case SENT_IP4:
i += 4 * PADUP(sizeof(struct sockaddr_in));
i += 4 * sizeof(struct sadb_address);
break;
-#endif /* INET */
#ifdef INET6
case SENT_IP6:
i += 4 * PADUP(sizeof(struct sockaddr_in6));
switch (ipo->ipo_src.sa.sa_family) {
case 0:
break;
-#ifdef INET
case AF_INET:
i += PADUP(sizeof(struct sockaddr_in));
i += sizeof(struct sadb_address);
break;
-#endif /* INET */
#ifdef INET6
case AF_INET6:
i += PADUP(sizeof(struct sockaddr_in6));
switch (ipo->ipo_dst.sa.sa_family) {
case 0:
break;
-#ifdef INET
case AF_INET:
i += PADUP(sizeof(struct sockaddr_in));
i += sizeof(struct sadb_address);
break;
-#endif /* INET */
#ifdef INET6
case AF_INET6:
i += PADUP(sizeof(struct sockaddr_in6));
-/* $OpenBSD: pfkeyv2_convert.c,v 1.43 2014/07/12 18:44:22 tedu Exp $ */
+/* $OpenBSD: pfkeyv2_convert.c,v 1.44 2014/12/19 17:14:40 tedu Exp $ */
/*
* The author of this code is Angelos D. Keromytis (angelos@keromytis.org)
*
switch (src->sa.sa_family)
{
-#ifdef INET
case AF_INET:
/* netmask handling */
rt_maskedcopy(&src->sa, &src->sa, &srcmask->sa);
if (transproto)
flowmask->sen_proto = 0xff;
break;
-#endif /* INET */
#ifdef INET6
case AF_INET6:
}
switch (flow->sen_type) {
-#ifdef INET
case SENT_IP4:
sab->sadb_protocol_direction = flow->sen_direction;
break;
-#endif /* INET */
#ifdef INET6
case SENT_IP6:
sab->sadb_protocol_direction = flow->sen_ip6_direction;
sab->sadb_protocol_len = sizeof(struct sadb_protocol) /
sizeof(uint64_t);
switch (flow->sen_type) {
-#ifdef INET
case SENT_IP4:
sab->sadb_protocol_proto = flow->sen_proto;
break;
-#endif /* INET */
#ifdef INET6
case SENT_IP6:
sab->sadb_protocol_proto = flow->sen_ip6_proto;
salen = ssa->sa_len;
else
switch (ssa->sa_family) {
-#ifdef INET
case AF_INET:
salen = sizeof(struct sockaddr_in);
break;
-#endif /* INET */
#ifdef INET6
case AF_INET6:
-/* $OpenBSD: pipex.c,v 1.64 2014/12/01 06:55:05 yasuoka Exp $ */
+/* $OpenBSD: pipex.c,v 1.65 2014/12/19 17:14:40 tedu Exp $ */
/*-
* Copyright (c) 2009 Internet Initiative Japan Inc.
#include <net/bpf.h>
#endif
-#ifdef INET
#include <netinet/ip.h>
#include <netinet/ip_var.h>
#ifdef INET6
#include <netinet/tcp.h>
#include <netinet/udp.h>
#include <netinet/udp_var.h>
-#endif
#include <crypto/arc4.h>
/* drop static for ddb debuggability */
-/* $OpenBSD: radix_mpath.c,v 1.26 2014/11/18 02:37:31 tedu Exp $ */
+/* $OpenBSD: radix_mpath.c,v 1.27 2014/12/19 17:14:40 tedu Exp $ */
/* $KAME: radix_mpath.c,v 1.13 2002/10/28 21:05:59 itojun Exp $ */
/*
rtalloc_mpath(struct sockaddr *dst, u_int32_t *srcaddrp, u_int rtableid)
{
struct rtentry *rt;
-#if defined(INET) || defined(INET6)
struct radix_node *rn;
int hash, npaths, threshold;
-#endif
rt = rtalloc(dst, RT_REPORT|RT_RESOLVE, rtableid);
/* check if multipath routing is enabled for the specified protocol */
if (!(0
-#ifdef INET
|| (ipmultipath && dst->sa_family == AF_INET)
-#endif
#ifdef INET6
|| (ip6_multipath && dst->sa_family == AF_INET6)
#endif
))
return (rt);
-#if defined(INET) || defined(INET6)
/* gw selection by Hash-Threshold (RFC 2992) */
rn = (struct radix_node *)rt;
npaths = rn_mpath_active_count(rn);
rt = (struct rtentry *)rn;
rt->rt_refcnt++;
}
-#endif
return (rt);
}
c = hashjitter;
switch (dst->sa_family) {
-#ifdef INET
case AF_INET:
{
struct sockaddr_in *sin_dst;
mix(a, b, c);
break;
}
-#endif /* INET */
#ifdef INET6
case AF_INET6:
{
-/* $OpenBSD: if_ether.c,v 1.138 2014/12/05 15:50:04 mpi Exp $ */
+/* $OpenBSD: if_ether.c,v 1.139 2014/12/19 17:14:40 tedu Exp $ */
/* $NetBSD: if_ether.c,v 1.31 1996/05/11 12:59:58 mycroft Exp $ */
/*
* add "inuse/lock" bit (or ref. count) along with valid bit
*/
-#ifdef INET
#include "carp.h"
#include "bridge.h"
return (0);
}
#endif
-#endif /* INET */
-/* $OpenBSD: in.c,v 1.112 2014/11/25 15:35:10 mpi Exp $ */
+/* $OpenBSD: in.c,v 1.113 2014/12/19 17:14:40 tedu Exp $ */
/* $NetBSD: in.c,v 1.26 1996/02/13 23:41:39 christos Exp $ */
/*
#include "ether.h"
-#ifdef INET
void in_socktrim(struct sockaddr_in *);
void in_len2mask(struct in_addr *, int);
}
}
-#endif
void
in_ifdetach(struct ifnet *ifp)
-/* $OpenBSD: ip_ah.c,v 1.112 2014/12/05 15:50:04 mpi Exp $ */
+/* $OpenBSD: ip_ah.c,v 1.113 2014/12/19 17:14:40 tedu Exp $ */
/*
* The authors of this code are John Ioannidis (ji@tla.org),
* Angelos D. Keromytis (kermit@csd.uch.gr) and
#include <net/if_var.h>
#include <net/bpf.h>
-#ifdef INET
#include <netinet/in.h>
#include <netinet/ip.h>
#include <netinet/ip_var.h>
-#endif /* INET */
#ifdef INET6
-#ifndef INET
-#include <netinet/in.h>
-#endif /* INET */
#include <netinet/ip6.h>
#endif /* INET6 */
unsigned char *ptr;
int off, count;
-#ifdef INET
struct ip *ip;
-#endif /* INET */
#ifdef INET6
struct ip6_ext *ip6e;
#endif /* INET6 */
switch (proto) {
-#ifdef INET
case AF_INET:
/*
* This is the least painful way of dealing with IPv4 header
}
break;
-#endif /* INET */
#ifdef INET6
case AF_INET6: /* Ugly... */
rplen = AH_FLENGTH + sizeof(u_int32_t);
switch (tdb->tdb_dst.sa.sa_family) {
-#ifdef INET
case AF_INET:
/* Check for IP maximum packet size violations. */
if (rplen + ahx->authsize + m->m_pkthdr.len > IP_MAXPACKET) {
return EMSGSIZE;
}
break;
-#endif /* INET */
#ifdef INET6
case AF_INET6:
* header length as it will be fixed by our caller.
*/
switch (tdb->tdb_dst.sa.sa_family) {
-#ifdef INET
case AF_INET:
bcopy(((caddr_t)(tc + 1)) +
offsetof(struct ip, ip_len),
m_copyback(m, offsetof(struct ip, ip_len),
sizeof(u_int16_t), &iplen, M_NOWAIT);
break;
-#endif /* INET */
#ifdef INET6
case AF_INET6:
-/* $OpenBSD: ip_carp.c,v 1.242 2014/12/17 09:57:13 mpi Exp $ */
+/* $OpenBSD: ip_carp.c,v 1.243 2014/12/19 17:14:40 tedu Exp $ */
/*
* Copyright (c) 2002 Michael Shalayeff. All rights reserved.
#include <crypto/sha1.h>
-#ifdef INET
#include <netinet/in.h>
#include <netinet/in_var.h>
#include <netinet/ip.h>
#include <net/if_enc.h>
#include <net/if_dl.h>
-#endif
#ifdef INET6
#include <netinet6/in6_var.h>
SHA1Update(&vhe->vhe_sha1[ctx], (void *)&vhid, sizeof(vhid));
/* Hash the addresses from smallest to largest, not interface order */
-#ifdef INET
cur.s_addr = 0;
do {
found = 0;
SHA1Update(&vhe->vhe_sha1[ctx],
(void *)&cur, sizeof(cur));
} while (found);
-#endif /* INET */
#ifdef INET6
memset(&cur6, 0x00, sizeof(cur6));
do {
sc->cur_vhe = vhe; /* we need the vhe later on the output path */
-#ifdef INET
if (sc->sc_naddrs) {
struct ip *ip;
}
}
}
-#endif /* INET */
#ifdef INET6
if (sc->sc_naddrs6) {
struct ip6_hdr *ip6;
if (vhe->vhe_leader)
sc->sc_delayed_arp = -1;
switch (af) {
-#ifdef INET
case AF_INET:
timeout_add(&vhe->md_tmo, tvtohz(&tv));
break;
-#endif /* INET */
#ifdef INET6
case AF_INET6:
timeout_add(&vhe->md6_tmo, tvtohz(&tv));
case SIOCSIFADDR:
s = splnet();
switch (ifa->ifa_addr->sa_family) {
-#ifdef INET
case AF_INET:
sc->sc_if.if_flags |= IFF_UP;
/*
error = carp_set_addr(sc, satosin(ifa->ifa_addr));
break;
-#endif /* INET */
#ifdef INET6
case AF_INET6:
sc->sc_if.if_flags |= IFF_UP;
-/* $OpenBSD: ip_ecn.c,v 1.6 2014/07/22 11:06:10 mpi Exp $ */
+/* $OpenBSD: ip_ecn.c,v 1.7 2014/12/19 17:14:40 tedu Exp $ */
/* $KAME: ip_ecn.c,v 1.9 2000/10/01 12:44:48 itojun Exp $ */
/*
#include <sys/systm.h>
#include <sys/mbuf.h>
-#ifdef INET
#include <netinet/in.h>
#include <netinet/ip.h>
-#endif
#ifdef INET6
-#ifndef INET
-#include <netinet/in.h>
-#endif
#include <netinet/ip6.h>
#endif
-/* $OpenBSD: ip_esp.c,v 1.128 2014/12/05 15:50:04 mpi Exp $ */
+/* $OpenBSD: ip_esp.c,v 1.129 2014/12/19 17:14:40 tedu Exp $ */
/*
* The authors of this code are John Ioannidis (ji@tla.org),
* Angelos D. Keromytis (kermit@csd.uch.gr) and
#include <net/if_var.h>
#include <net/bpf.h>
-#ifdef INET
#include <netinet/in.h>
#include <netinet/ip.h>
#include <netinet/ip_var.h>
-#endif /* INET */
#ifdef INET6
-#ifndef INET
-#include <netinet/in.h>
-#endif
#include <netinet/ip6.h>
#endif /* INET6 */
espstat.esps_output++;
switch (tdb->tdb_dst.sa.sa_family) {
-#ifdef INET
case AF_INET:
/* Check for IP maximum packet size violations. */
if (skip + hlen + rlen + padding + alen > IP_MAXPACKET) {
return EMSGSIZE;
}
break;
-#endif /* INET */
#ifdef INET6
case AF_INET6:
-/* $OpenBSD: ip_ether.c,v 1.69 2014/09/14 14:17:26 jsg Exp $ */
+/* $OpenBSD: ip_ether.c,v 1.70 2014/12/19 17:14:40 tedu Exp $ */
/*
* The author of this code is Angelos D. Keromytis (kermit@adk.gr)
*
#include <net/netisr.h>
#include <net/route.h>
-#ifdef INET
#include <netinet/in.h>
#include <netinet/ip.h>
#include <netinet/in_pcb.h>
#include <netinet/ip_var.h>
-#endif /* INET */
#include <netinet/ip_ether.h>
#include <netinet/if_ether.h>
struct etheripstat etheripstat;
-#ifdef INET
/*
* etherip_input gets called when we receive an encapsulated packet.
* Only a wrapper for the IPv4 case.
return;
}
}
-#endif
#ifdef INET6
int
v = *mtod(m, u_int8_t *);
switch (v >> 4) {
-#ifdef INET
case 4:
ssrc.sa.sa_len = sdst.sa.sa_len = sizeof(struct sockaddr_in);
ssrc.sa.sa_family = sdst.sa.sa_family = AF_INET;
sizeof(struct in_addr),
(caddr_t) &sdst.sin.sin_addr);
break;
-#endif /* INET */
#ifdef INET6
case 6:
ssrc.sa.sa_len = sdst.sa.sa_len = sizeof(struct sockaddr_in6);
int
etherip_output(struct mbuf *m, struct tdb *tdb, struct mbuf **mp, int proto)
{
-#ifdef INET
struct ip *ipo;
-#endif /* INET */
#ifdef INET6
struct ip6_hdr *ip6;
#endif /* INET6 */
}
switch (tdb->tdb_dst.sa.sa_family) {
-#ifdef INET
case AF_INET:
hlen = sizeof(struct ip);
break;
-#endif /* INET */
#ifdef INET6
case AF_INET6:
hlen = sizeof(struct ip6_hdr);
etheripstat.etherip_obytes += m->m_pkthdr.len - hlen;
switch (tdb->tdb_dst.sa.sa_family) {
-#ifdef INET
case AF_INET:
ipo = mtod(m, struct ip *);
ipo->ip_src = tdb->tdb_src.sin.sin_addr;
ipo->ip_dst = tdb->tdb_dst.sin.sin_addr;
break;
-#endif /* INET */
#ifdef INET6
case AF_INET6:
ip6 = mtod(m, struct ip6_hdr *);
-/* $OpenBSD: ip_gre.c,v 1.51 2014/09/14 14:17:26 jsg Exp $ */
+/* $OpenBSD: ip_gre.c,v 1.52 2014/12/19 17:14:40 tedu Exp $ */
/* $NetBSD: ip_gre.c,v 1.9 1999/10/25 19:18:11 drochner Exp $ */
/*
#include <net/route.h>
#include <net/bpf.h>
-#ifdef INET
#include <netinet/in.h>
#include <netinet/ip.h>
#include <netinet/ip_var.h>
#include <netinet/ip_gre.h>
#include <netinet/if_ether.h>
#include <netinet/in_pcb.h>
-#else
-#error "ip_gre used without inet"
-#endif
#ifdef MPLS
#include <netmpls/mpls.h>
-/* $OpenBSD: ip_ipcomp.c,v 1.38 2014/12/05 15:50:04 mpi Exp $ */
+/* $OpenBSD: ip_ipcomp.c,v 1.39 2014/12/19 17:14:40 tedu Exp $ */
/*
* Copyright (c) 2001 Jean-Jacques Bernard-Gundol (jj@wabbitt.org)
#include <net/if_var.h>
#include <net/bpf.h>
-#ifdef INET
#include <netinet/in.h>
#include <netinet/ip.h>
#include <netinet/ip_var.h>
-#endif /* INET */
#ifdef INET6
-#ifndef INET
-#include <netinet/in.h>
-#endif
#include <netinet/ip6.h>
#endif /* INET6 */
ipcompstat.ipcomps_output++;
switch (tdb->tdb_dst.sa.sa_family) {
-#ifdef INET
case AF_INET:
/* Check for IPv4 maximum packet size violations */
/*
return EMSGSIZE;
}
break;
-#endif /* INET */
#ifdef INET6
case AF_INET6:
struct mbuf *m, *mo;
int error, s, skip, rlen;
u_int16_t cpi;
-#ifdef INET
struct ip *ip;
-#endif
#ifdef INET6
struct ip6_hdr *ip6;
#endif
/* m_pullup before ? */
switch (tdb->tdb_dst.sa.sa_family) {
-#ifdef INET
case AF_INET:
ip = mtod(m, struct ip *);
ipcomp->ipcomp_nh = ip->ip_p;
ip->ip_p = IPPROTO_IPCOMP;
break;
-#endif /* INET */
#ifdef INET6
case AF_INET6:
ip6 = mtod(m, struct ip6_hdr *);
-/* $OpenBSD: ip_ipip.c,v 1.55 2014/12/05 15:50:04 mpi Exp $ */
+/* $OpenBSD: ip_ipip.c,v 1.56 2014/12/19 17:14:40 tedu Exp $ */
/*
* The authors of this code are John Ioannidis (ji@tla.org),
* Angelos D. Keromytis (kermit@csd.uch.gr) and
}
#endif /* INET6 */
-#ifdef INET
/*
* Really only a wrapper for ipip_input(), for use with IPv4.
*/
ipip_input(m, iphlen, NULL, ip->ip_p);
}
-#endif /* INET */
/*
* ipip_input gets called when we receive an IP{46} encapsulated packet,
m_copydata(m, 0, 1, &v);
switch (v >> 4) {
-#ifdef INET
case 4:
hlen = sizeof(struct ip);
break;
-#endif /* INET */
#ifdef INET6
case 6:
hlen = sizeof(struct ip6_hdr);
/* Keep outer ecn field. */
switch (v >> 4) {
-#ifdef INET
case 4:
ipo = mtod(m, struct ip *);
otos = ipo->ip_tos;
break;
-#endif /* INET */
#ifdef INET6
case 6:
ip6 = mtod(m, struct ip6_hdr *);
}
switch (proto) {
-#ifdef INET
case IPPROTO_IPV4:
hlen = sizeof(struct ip);
break;
-#endif /* INET */
#ifdef INET6
case IPPROTO_IPV6:
/* Some sanity checks in the inner IP header */
switch (proto) {
-#ifdef INET
case IPPROTO_IPV4:
ipo = mtod(m, struct ip *);
#ifdef INET6
}
}
break;
-#endif /* INET */
#ifdef INET6
case IPPROTO_IPV6:
-#ifdef INET
ipo = NULL;
-#endif
ip6 = mtod(m, struct ip6_hdr *);
itos = (ntohl(ip6->ip6_flow) >> 20) & 0xff;
if (!ip_ecn_egress(ECN_ALLOWED, &otos, &itos)) {
break;
#endif
default:
-#ifdef INET
ipo = NULL;
-#endif
#ifdef INET6
ip6 = NULL;
#endif
if (ifp->if_rdomain != rdomain)
continue;
TAILQ_FOREACH(ifa, &ifp->if_addrlist, ifa_list) {
-#ifdef INET
if (ipo) {
if (ifa->ifa_addr->sa_family !=
AF_INET)
return;
}
}
-#endif /* INET */
#ifdef INET6
if (ip6) {
if (ifa->ifa_addr->sa_family !=
*/
switch (proto) {
-#ifdef INET
case IPPROTO_IPV4:
ifq = &ipintrq;
isr = NETISR_IP;
af = AF_INET;
break;
-#endif
#ifdef INET6
case IPPROTO_IPV6:
ifq = &ip6intrq;
{
u_int8_t tp, otos;
-#ifdef INET
u_int8_t itos;
struct ip *ipo;
-#endif /* INET */
#ifdef INET6
struct ip6_hdr *ip6, *ip6o;
tp = (tp >> 4) & 0xff; /* Get the IP version number. */
switch (tdb->tdb_dst.sa.sa_family) {
-#ifdef INET
case AF_INET:
if (tdb->tdb_src.sa.sa_family != AF_INET ||
tdb->tdb_src.sin.sin_addr.s_addr == INADDR_ANY ||
ip_ecn_ingress(ECN_ALLOWED, &otos, &itos);
ipo->ip_tos = otos;
break;
-#endif /* INET */
#ifdef INET6
case AF_INET6:
in6_embedscope(&ip6o->ip6_src, &tdb->tdb_src.sin6, NULL, NULL);
in6_embedscope(&ip6o->ip6_dst, &tdb->tdb_dst.sin6, NULL, NULL);
-#ifdef INET
if (tp == IPVERSION) {
/* Save ECN notification */
m_copydata(m, sizeof(struct ip6_hdr) +
ip6o->ip6_nxt = IPPROTO_IPIP;
}
else
-#endif /* INET */
if (tp == (IPV6_VERSION >> 4)) {
u_int32_t itos32;
ipipstat.ipips_opackets++;
*mp = m;
-#ifdef INET
if (tdb->tdb_dst.sa.sa_family == AF_INET) {
if (tdb->tdb_xform->xf_type == XF_IP4)
tdb->tdb_cur_bytes +=
ipipstat.ipips_obytes += m->m_pkthdr.len - sizeof(struct ip);
}
-#endif /* INET */
#ifdef INET6
if (tdb->tdb_dst.sa.sa_family == AF_INET6) {
-/* $OpenBSD: ip_ipsp.c,v 1.201 2014/12/09 07:05:06 doug Exp $ */
+/* $OpenBSD: ip_ipsp.c,v 1.202 2014/12/19 17:14:40 tedu Exp $ */
/*
* The authors of this code are John Ioannidis (ji@tla.org),
* Angelos D. Keromytis (kermit@csd.uch.gr),
#include <net/if_pfsync.h>
#endif
-#ifdef INET
#include <netinet/in.h>
#include <netinet/ip.h>
#include <netinet/in_pcb.h>
#include <netinet/ip_var.h>
-#endif /* INET */
#ifdef INET6
-#ifndef INET
-#include <netinet/in.h>
-#endif
#endif /* INET6 */
#include <netinet/ip_ipsp.h>
buf = ipspbuf[ipspround];
switch (sa.sa.sa_family) {
-#ifdef INET
case AF_INET:
return inet_ntop(AF_INET, &sa.sin.sin_addr,
buf, INET_ADDRSTRLEN);
-#endif /* INET */
#ifdef INET6
case AF_INET6:
ipsp_is_unspecified(union sockaddr_union addr)
{
switch (addr.sa.sa_family) {
-#ifdef INET
case AF_INET:
if (addr.sin.sin_addr.s_addr == INADDR_ANY)
return 1;
else
return 0;
-#endif /* INET */
#ifdef INET6
case AF_INET6:
struct m_tag *mtag;
struct tdb *tdb;
-#ifdef INET
struct ip iph;
-#endif /* INET */
#ifdef INET6
struct in6_addr ip6_dst;
while (1) {
switch (proto) {
-#ifdef INET
case IPPROTO_IPV4: /* Also IPPROTO_IPIP */
{
/*
off += iph.ip_hl << 2;
break;
}
-#endif /* INET */
#ifdef INET6
case IPPROTO_IPV6:
s = splsoftnet();
-#ifdef INET
if (ipv4sa) {
su.sin.sin_family = AF_INET;
su.sin.sin_len = sizeof(struct sockaddr_in);
su.sin.sin_addr = iph.ip_dst;
}
-#endif /* INET */
#ifdef INET6
if (!ipv4sa) {
tdbi->proto = proto; /* AH or ESP */
tdbi->rdomain = rtable_l2(m->m_pkthdr.ph_rtableid);
-#ifdef INET
/* Last network header was IPv4. */
if (ipv4sa) {
tdbi->dst.sin.sin_family = AF_INET;
sizeof(struct sockaddr_in);
tdbi->dst.sin.sin_addr = iph.ip_dst;
}
-#endif /* INET */
#ifdef INET6
/* Last network header was IPv6. */
-/* $OpenBSD: ip_spd.c,v 1.76 2014/11/25 13:10:03 mpi Exp $ */
+/* $OpenBSD: ip_spd.c,v 1.77 2014/12/19 17:14:40 tedu Exp $ */
/*
* The author of this code is Angelos D. Keromytis (angelos@cis.upenn.edu)
*
#include <net/route.h>
#include <net/netisr.h>
-#ifdef INET
#include <netinet/in.h>
#include <netinet/ip.h>
#include <netinet/ip_var.h>
#include <netinet/in_pcb.h>
-#endif /* INET */
#ifdef INET6
-#ifndef INET
-#include <netinet/in.h>
-#endif
#endif /* INET6 */
#include <netinet/ip_ipsp.h>
ddst->sen_len = SENT_LEN;
switch (af) {
-#ifdef INET
case AF_INET:
if (hlen < sizeof (struct ip) || m->m_pkthdr.len < hlen) {
*error = EINVAL;
}
break;
-#endif /* INET */
#ifdef INET6
case AF_INET6:
/* Check for non-specific destination in the policy. */
switch (ipo->ipo_dst.sa.sa_family) {
-#ifdef INET
case AF_INET:
if ((ipo->ipo_dst.sin.sin_addr.s_addr == INADDR_ANY) ||
(ipo->ipo_dst.sin.sin_addr.s_addr == INADDR_BROADCAST))
dignore = 1;
break;
-#endif /* INET */
#ifdef INET6
case AF_INET6:
/* Likewise for source. */
switch (ipo->ipo_src.sa.sa_family) {
-#ifdef INET
case AF_INET:
if (ipo->ipo_src.sin.sin_addr.s_addr == INADDR_ANY)
signore = 1;
break;
-#endif /* INET */
#ifdef INET6
case AF_INET6:
switch (af) {
case AF_INET:
-#ifdef INET
ipon->ipo_addr.sen_type = ipon->ipo_mask.sen_type = SENT_IP4;
ipon->ipo_addr.sen_ip_src = inp->inp_laddr;
ipon->ipo_addr.sen_ip_dst = inp->inp_faddr;
ipon->ipo_dst.sa.sa_len = sizeof(struct sockaddr_in);
ipon->ipo_src.sin.sin_addr = inp->inp_laddr;
ipon->ipo_dst.sin.sin_addr = inp->inp_faddr;
-#endif /* INET */
break;
case AF_INET6:
/* Just copy the right information. */
switch (ipo->ipo_addr.sen_type) {
-#ifdef INET
case SENT_IP4:
ipa->ipa_info.sen_type = ipa->ipa_mask.sen_type = SENT_IP4;
ipa->ipa_info.sen_direction = ipo->ipo_addr.sen_direction;
ipa->ipa_mask.sen_dport = ipo->ipo_mask.sen_dport;
}
break;
-#endif /* INET */
#ifdef INET6
case SENT_IP6:
-/* $OpenBSD: ipsec_input.c,v 1.124 2014/12/05 15:50:04 mpi Exp $ */
+/* $OpenBSD: ipsec_input.c,v 1.125 2014/12/19 17:14:40 tedu Exp $ */
/*
* The authors of this code are John Ioannidis (ji@tla.org),
* Angelos D. Keromytis (kermit@csd.uch.gr) and
#include "bpfilter.h"
void *ipsec_common_ctlinput(u_int, int, struct sockaddr *, void *, int);
-#ifdef INET
int ah4_input_cb(struct mbuf *, ...);
int esp4_input_cb(struct mbuf *, ...);
int ipcomp4_input_cb(struct mbuf *, ...);
-#endif
#ifdef INET6
int ah6_input_cb(struct mbuf *, int, int);
#endif
(sproto == IPPROTO_IPCOMP && !ipcomp_enable)) {
switch (af) {
-#ifdef INET
case AF_INET:
rip_input(m, skip, sproto);
break;
-#endif /* INET */
#ifdef INET6
case AF_INET6:
rip6_input(&m, &skip, sproto);
dst_address.sa.sa_family = af;
switch (af) {
-#ifdef INET
case AF_INET:
dst_address.sin.sin_len = sizeof(struct sockaddr_in);
m_copydata(m, offsetof(struct ip, ip_dst),
sizeof(struct in_addr),
(caddr_t) &(dst_address.sin.sin_addr));
break;
-#endif /* INET */
#ifdef INET6
case AF_INET6:
struct ifnet *encif;
#endif
-#ifdef INET
struct ip *ip, ipn;
-#endif /* INET */
#ifdef INET6
struct ip6_hdr *ip6, ip6n;
return EINVAL;
}
-#ifdef INET
/* Fix IPv4 header */
if (af == AF_INET) {
if ((m->m_len < skip) && ((m = m_pullup(m, skip)) == NULL)) {
}
#endif /* INET6 */
}
-#endif /* INET */
#ifdef INET6
/* Fix IPv6 header */
/* Save protocol */
m_copydata(m, protoff, 1, (caddr_t) &prot);
-#ifdef INET
/* IP-in-IP encapsulation */
if (prot == IPPROTO_IPIP) {
if (m->m_pkthdr.len - skip < sizeof(struct ip)) {
return EACCES;
}
}
-#endif /* INET */
/* IPv6-in-IP encapsulation */
if (prot == IPPROTO_IPV6) {
/* Call the appropriate IPsec transform callback. */
switch (af) {
-#ifdef INET
case AF_INET:
switch (sproto)
{
return EPFNOSUPPORT;
}
break;
-#endif /* INET */
#ifdef INET6
case AF_INET6:
}
}
-#ifdef INET
/* IPv4 AH wrapper. */
void
ah4_input(struct mbuf *m, ...)
return (ipsec_common_ctlinput(rdomain, cmd, sa, v, IPPROTO_ESP));
}
-#endif /* INET */
#ifdef INET6
/* IPv6 AH wrapper. */
-/* $OpenBSD: ipsec_output.c,v 1.54 2014/09/08 06:24:13 jsg Exp $ */
+/* $OpenBSD: ipsec_output.c,v 1.55 2014/12/19 17:14:40 tedu Exp $ */
/*
* The author of this code is Angelos D. Keromytis (angelos@cis.upenn.edu)
*
#include <net/pfvar.h>
#endif
-#ifdef INET
#include <netinet/in.h>
#include <netinet/ip.h>
#include <netinet/in_pcb.h>
#include <netinet/ip_var.h>
-#endif /* INET */
#ifdef INET6
-#ifndef INET
-#include <netinet/in.h>
-#endif
#endif /* INET6 */
#include <netinet/udp.h>
int dstopt = 0;
#endif
-#ifdef INET
int setdf = 0;
struct ip *ip;
-#endif /* INET */
#ifdef INET6
struct ip6_hdr *ip6;
#endif /* INET6 */
/* Check that the network protocol is supported */
switch (tdb->tdb_dst.sa.sa_family) {
-#ifdef INET
case AF_INET:
break;
-#endif /* INET */
#ifdef INET6
case AF_INET6:
* doing tunneling.
*/
if (af == tdb->tdb_dst.sa.sa_family) {
-#ifdef INET
if (af == AF_INET)
i = sizeof(struct ip);
-#endif /* INET */
#ifdef INET6
if (af == AF_INET6)
return ENOBUFS;
}
-#ifdef INET
if (af == AF_INET) {
ip = mtod(m, struct ip *);
*/
setdf = ip->ip_off & htons(IP_DF);
}
-#endif /* INET */
#ifdef INET6
if (af == AF_INET6)
if ((tdb->tdb_dst.sa.sa_family != af) || /* PF mismatch */
(tdb->tdb_flags & TDBF_TUNNELING) || /* Tunneling needed */
(tdb->tdb_xform->xf_type == XF_IP4) || /* ditto */
-#ifdef INET
((tdb->tdb_dst.sa.sa_family == AF_INET) &&
(tdb->tdb_dst.sin.sin_addr.s_addr != INADDR_ANY) &&
(tdb->tdb_dst.sin.sin_addr.s_addr != ip->ip_dst.s_addr)) ||
-#endif /* INET */
#ifdef INET6
((tdb->tdb_dst.sa.sa_family == AF_INET6) &&
(!IN6_IS_ADDR_UNSPECIFIED(&tdb->tdb_dst.sin6.sin6_addr)) &&
&ip6->ip6_dst))) ||
#endif /* INET6 */
0) {
-#ifdef INET
/* Fix IPv4 header checksum and length. */
if (af == AF_INET) {
if (m->m_len < sizeof(struct ip))
ip->ip_sum = 0;
ip->ip_sum = in_cksum(m, ip->ip_hl << 2);
}
-#endif /* INET */
#ifdef INET6
/* Fix IPv6 header payload length. */
m = mp;
mp = NULL;
-#ifdef INET
if (tdb->tdb_dst.sa.sa_family == AF_INET && setdf) {
if (m->m_len < sizeof(struct ip))
if ((m = m_pullup(m,
ip = mtod(m, struct ip *);
ip->ip_off |= htons(IP_DF);
}
-#endif
/* Remember that we appended a tunnel header. */
tdb->tdb_flags |= TDBF_USEDTUNNEL;
/* Extract some information off the headers. */
switch (tdb->tdb_dst.sa.sa_family) {
-#ifdef INET
case AF_INET:
ip = mtod(m, struct ip *);
i = ip->ip_hl << 2;
off = offsetof(struct ip, ip_p);
break;
-#endif /* INET */
#ifdef INET6
case AF_INET6:
int
ipsp_process_done(struct mbuf *m, struct tdb *tdb)
{
-#ifdef INET
struct ip *ip;
-#endif /* INET */
#ifdef INET6
struct ip6_hdr *ip6;
}
switch (tdb->tdb_dst.sa.sa_family) {
-#ifdef INET
case AF_INET:
/* Fix the header length, for AH processing. */
ip = mtod(m, struct ip *);
if ((tdb->tdb_flags & TDBF_UDPENCAP) != 0)
ip->ip_p = IPPROTO_UDP;
break;
-#endif /* INET */
#ifdef INET6
case AF_INET6:
* performed again there.
*/
switch (tdb->tdb_dst.sa.sa_family) {
-#ifdef INET
case AF_INET:
return (ip_output(m, NULL, NULL, IP_RAWOUTPUT, NULL, NULL, 0));
-#endif /* INET */
#ifdef INET6
case AF_INET6:
return (adjust);
switch (tdbp->tdb_dst.sa.sa_family) {
-#ifdef INET
case AF_INET:
adjust += sizeof(struct ip);
break;
-#endif /* INET */
#ifdef INET6
case AF_INET6:
adjust += sizeof(struct ip6_hdr);
-/* $OpenBSD: tcp_input.c,v 1.285 2014/12/05 15:50:04 mpi Exp $ */
+/* $OpenBSD: tcp_input.c,v 1.286 2014/12/19 17:14:40 tedu Exp $ */
/* $NetBSD: tcp_input.c,v 1.23 1996/02/13 23:43:44 christos Exp $ */
/*
bzero(&src, sizeof(src));
bzero(&dst, sizeof(dst));
switch (af) {
-#ifdef INET
case AF_INET:
src.sin.sin_len = sizeof(struct sockaddr_in);
src.sin.sin_family = AF_INET;
dst.sin.sin_addr = ip->ip_dst;
dst.sin.sin_port = th->th_dport;
break;
-#endif
#ifdef INET6
case AF_INET6:
src.sin6.sin6_len = sizeof(struct sockaddr_in6);
switch (tp->pf) {
case 0:
-#ifdef INET
case AF_INET:
src.sa.sa_len = sizeof(struct sockaddr_in);
src.sa.sa_family = AF_INET;
dst.sa.sa_family = AF_INET;
dst.sin.sin_addr = mtod(m, struct ip *)->ip_dst;
break;
-#endif
#ifdef INET6
case AF_INET6:
src.sa.sa_len = sizeof(struct sockaddr_in6);
}
switch (src->sa_family) {
-#ifdef INET
case AF_INET:
/*
* Remember the IP options, if any.
*/
ipopts = ip_srcroute(m);
break;
-#endif
default:
ipopts = NULL;
}
switch (sc->sc_src.sa.sa_family) {
case 0: /*default to PF_INET*/
-#ifdef INET
case AF_INET:
src.sin.sin_addr = mtod(m, struct ip *)->ip_src;
dst.sin.sin_addr = mtod(m, struct ip *)->ip_dst;
break;
-#endif /* INET */
#ifdef INET6
case AF_INET6:
src.sin6.sin6_addr = mtod(m, struct ip6_hdr *)->ip6_src;
* ip_len to be in host order, for convenience.
*/
switch (sc->sc_src.sa.sa_family) {
-#ifdef INET
case AF_INET:
ip->ip_len = htons(tlen);
ip->ip_ttl = inp ? inp->inp_ip.ip_ttl : ip_defttl;
if (inp != NULL)
ip->ip_tos = inp->inp_ip.ip_tos;
break;
-#endif
#ifdef INET6
case AF_INET6:
ip6->ip6_vfc &= ~IPV6_VERSION_MASK;
}
switch (sc->sc_src.sa.sa_family) {
-#ifdef INET
case AF_INET:
error = ip_output(m, sc->sc_ipopts, ro,
(ip_mtudisc ? IP_MTUDISC : 0), NULL, inp, 0);
break;
-#endif
#ifdef INET6
case AF_INET6:
ip6->ip6_hlim = in6_selecthlim(NULL,
-/* $OpenBSD: tcp_output.c,v 1.107 2014/07/22 11:06:10 mpi Exp $ */
+/* $OpenBSD: tcp_output.c,v 1.108 2014/12/19 17:14:40 tedu Exp $ */
/* $NetBSD: tcp_output.c,v 1.16 1997/06/03 16:17:09 kml Exp $ */
/*
switch (tp->pf) {
case 0: /*default to PF_INET*/
-#ifdef INET
case PF_INET:
hdrlen = sizeof(struct ip) + sizeof(struct tcphdr);
break;
-#endif /* INET */
#ifdef INET6
case PF_INET6:
hdrlen = sizeof(struct ip6_hdr) + sizeof(struct tcphdr);
switch (tp->pf) {
case 0: /*default to PF_INET*/
-#ifdef INET
case AF_INET:
iphlen = sizeof(struct ip);
src.sa.sa_len = sizeof(struct sockaddr_in);
dst.sa.sa_family = AF_INET;
dst.sin.sin_addr = mtod(m, struct ip *)->ip_dst;
break;
-#endif /* INET */
#ifdef INET6
case AF_INET6:
iphlen = sizeof(struct ip6_hdr);
switch (tp->pf) {
case 0: /*default to PF_INET*/
-#ifdef INET
case AF_INET:
{
struct ip *ip;
&tp->t_inpcb->inp_route,
(ip_mtudisc ? IP_MTUDISC : 0), NULL, tp->t_inpcb, 0);
break;
-#endif /* INET */
#ifdef INET6
case AF_INET6:
{
-/* $OpenBSD: tcp_subr.c,v 1.138 2014/11/18 02:37:31 tedu Exp $ */
+/* $OpenBSD: tcp_subr.c,v 1.139 2014/12/19 17:14:40 tedu Exp $ */
/* $NetBSD: tcp_subr.c,v 1.22 1996/02/13 23:44:00 christos Exp $ */
/*
switch (tp->pf) {
case 0: /*default to PF_INET*/
-#ifdef INET
case AF_INET:
m->m_len = sizeof(struct ip);
break;
-#endif /* INET */
#ifdef INET6
case AF_INET6:
m->m_len = sizeof(struct ip6_hdr);
}
switch(tp->pf) {
-#ifdef INET
case AF_INET:
{
struct ipovly *ipovly;
sizeof(struct ip));
}
break;
-#endif /* INET */
#ifdef INET6
case AF_INET6:
{
switch(af) {
case 0:
-#ifdef INET
case AF_INET: {
struct ippseudo ippseudo;
struct ip *ip;
sizeof(struct ippseudo));
break;
}
-#endif
#ifdef INET6
case AF_INET6: {
struct ip6_hdr_pseudo ip6pseudo;
-/* $OpenBSD: in6_gif.c,v 1.34 2014/12/05 15:50:04 mpi Exp $ */
+/* $OpenBSD: in6_gif.c,v 1.35 2014/12/19 17:14:40 tedu Exp $ */
/* $KAME: in6_gif.c,v 1.43 2001/01/22 07:27:17 itojun Exp $ */
/*
#include <netinet/in.h>
#include <netinet/ip_ipsp.h>
-#ifdef INET
#include <netinet/ip.h>
-#endif
#include <netinet/ip6.h>
#include <netinet6/ip6_var.h>
xfs.xf_type = -1; /* not XF_IP4 */
switch (family) {
-#ifdef INET
case AF_INET:
break;
-#endif
#ifdef INET6
case AF_INET6:
break;
-/* $OpenBSD: in6_proto.c,v 1.76 2014/12/05 15:50:04 mpi Exp $ */
+/* $OpenBSD: in6_proto.c,v 1.77 2014/12/19 17:14:40 tedu Exp $ */
/* $KAME: in6_proto.c,v 1.66 2000/10/10 15:35:47 itojun Exp $ */
/*
{ SOCK_STREAM, &inet6domain, IPPROTO_TCP, PR_CONNREQUIRED|PR_WANTRCVD|PR_ABRTACPTDIS|PR_SPLICE,
tcp6_input, 0, tcp6_ctlinput, tcp_ctloutput,
tcp_usrreq,
-#ifdef INET /* don't call initialization and timeout routines twice */
0, 0, 0, 0,
-#else
- tcp_init, tcp_fasttimo, tcp_slowtimo, 0,
-#endif
tcp_sysctl,
},
{ SOCK_RAW, &inet6domain, IPPROTO_RAW, PR_ATOMIC|PR_ADDR,
rip6_usrreq, /* XXX */
0, 0, 0, 0,
},
-#ifdef INET
{ SOCK_RAW, &inet6domain, IPPROTO_IPV4, PR_ATOMIC|PR_ADDR,
in6_gif_input, rip6_output, 0, rip6_ctloutput,
rip6_usrreq, /* XXX */
0, 0, 0, 0,
},
-#endif /* INET */
#else /* NGIF */
{ SOCK_RAW, &inet6domain, IPPROTO_IPV6, PR_ATOMIC|PR_ADDR,
ip4_input6, rip6_output, 0, rip6_ctloutput,
rip6_usrreq, /* XXX */
0, 0, 0, 0, ipip_sysctl
},
-#ifdef INET
{ SOCK_RAW, &inet6domain, IPPROTO_IPV4, PR_ATOMIC|PR_ADDR,
ip4_input6, rip6_output, 0, rip6_ctloutput,
rip6_usrreq, /* XXX */
0, 0, 0, 0,
},
-#endif /* INET */
#endif /* GIF */
#ifdef PIM
{ SOCK_RAW, &inet6domain, IPPROTO_PIM, PR_ATOMIC|PR_ADDR,
-/* $OpenBSD: ip6_input.c,v 1.133 2014/12/05 15:50:04 mpi Exp $ */
+/* $OpenBSD: ip6_input.c,v 1.134 2014/12/19 17:14:40 tedu Exp $ */
/* $KAME: ip6_input.c,v 1.188 2001/03/29 05:34:31 itojun Exp $ */
/*
#include <netinet/in.h>
-#ifdef INET
#include <netinet/ip.h>
-#endif
#include <netinet/in_pcb.h>
#include <netinet6/in6_var.h>
#define EXPIRE_TIMEOUT (hz / 4) /* 4x / second */
#define UPCALL_EXPIRE 6 /* number of timeouts */
-#ifdef INET
#ifdef MROUTING
extern struct socket *ip_mrouter;
#endif
-#endif
/*
* 'Interfaces' associated with decapsulator (so we can tell
* For each phyint in use, disable promiscuous reception of all IPv6
* multicasts.
*/
-#ifdef INET
#ifdef MROUTING
/*
* If there is still IPv4 multicast routing daemon,
* daemon is not interested...
*/
if (!ip_mrouter)
-#endif
#endif
{
for (mifi = 0; mifi < nummifs; mifi++) {