-/* $OpenBSD: if.c,v 1.337 2015/06/03 22:01:07 mikeb Exp $ */
+/* $OpenBSD: if.c,v 1.338 2015/06/07 12:02:28 jsg Exp $ */
/* $NetBSD: if.c,v 1.35 1996/05/07 05:26:04 thorpej Exp $ */
/*
return (rv);
}
+
+__dead void
+unhandled_af(int af)
+{
+ panic("unhandled af %d", af);
+}
-/* $OpenBSD: if.h,v 1.163 2015/05/18 13:32:28 reyk Exp $ */
+/* $OpenBSD: if.h,v 1.164 2015/06/07 12:02:28 jsg Exp $ */
/* $NetBSD: if.h,v 1.23 1996/05/07 02:40:27 thorpej Exp $ */
/*
void ifnewlladdr(struct ifnet *);
void if_congestion(void);
int if_congested(void);
+__dead void unhandled_af(int);
#endif /* _KERNEL */
-/* $OpenBSD: if_pflow.c,v 1.49 2014/12/19 17:14:39 tedu Exp $ */
+/* $OpenBSD: if_pflow.c,v 1.50 2015/06/07 12:02:28 jsg Exp $ */
/*
* Copyright (c) 2011 Florian Obser <florian@narrans.de>
set_length = sizeof(struct pflow_set_header)
+ sc->sc_count6 * sizeof(struct pflow_ipfix_flow6);
break;
- default: /* NOTREACHED */
- break;
+ default:
+ unhandled_af(af);
}
if (!(ifp->if_flags & IFF_RUNNING)) {
-/* $OpenBSD: pf.c,v 1.917 2015/06/05 13:22:34 mikeb Exp $ */
+/* $OpenBSD: pf.c,v 1.918 2015/06/07 12:02:28 jsg Exp $ */
/*
* Copyright (c) 2001 Daniel Hartmeier
len = sizeof(struct ip6_hdr) + tlen;
break;
#endif /* INET6 */
+ default:
+ unhandled_af(af);
}
/* create outgoing mbuf */
icmptype = pd->hdr.icmp6->icmp6_type;
break;
#endif /* INET6 */
+ default:
+ panic("unhandled proto %d", pd->proto);
}
if (pf_icmp_mapping(pd, icmptype, &icmp_dir, &virtual_id,
pd2.dst = (struct pf_addr *)&h2_6.ip6_dst;
break;
#endif /* INET6 */
+ default:
+ unhandled_af(pd->af);
}
switch (pd2.proto) {
sum = in6_cksum(pd->m, p, off, len);
break;
#endif /* INET6 */
+ default:
+ unhandled_af(af);
}
if (sum) {
switch (p) {
-/* $OpenBSD: pf_table.c,v 1.108 2015/04/09 12:04:14 mikeb Exp $ */
+/* $OpenBSD: pf_table.c,v 1.109 2015/06/07 12:02:28 jsg Exp $ */
/*
* Copyright (c) 2002 Cedric Berger
int s;
bzero(&sa, sizeof(sa));
- if (ad->pfra_af == AF_INET) {
+ switch (ad->pfra_af) {
+ case AF_INET:
FILLIN_SIN(sa.sin, ad->pfra_ip4addr);
head = kt->pfrkt_ip4;
- } else if ( ad->pfra_af == AF_INET6 ) {
+ break;
+ case AF_INET6:
FILLIN_SIN6(sa.sin6, ad->pfra_ip6addr);
head = kt->pfrkt_ip6;
+ break;
+ default:
+ unhandled_af(ad->pfra_af);
}
if (ADDR_NETWORK(ad)) {
pfr_prepare_network(&mask, ad->pfra_af, ad->pfra_net);
int s;
bzero(ke->pfrke_node, sizeof(ke->pfrke_node));
- if (ke->pfrke_af == AF_INET)
+ switch (ke->pfrke_af) {
+ case AF_INET:
head = kt->pfrkt_ip4;
- else if (ke->pfrke_af == AF_INET6)
+ break;
+ case AF_INET6:
head = kt->pfrkt_ip6;
+ break;
+ default:
+ unhandled_af(ke->pfrke_af);
+ }
s = splsoftnet();
if (KENTRY_NETWORK(ke)) {
struct radix_node_head *head;
int s;
- if (ke->pfrke_af == AF_INET)
+ switch (ke->pfrke_af) {
+ case AF_INET:
head = kt->pfrkt_ip4;
- else if (ke->pfrke_af == AF_INET6)
+ break;
+ case AF_INET6:
head = kt->pfrkt_ip6;
+ break;
+ default:
+ unhandled_af(ke->pfrke_af);
+ }
s = splsoftnet();
if (KENTRY_NETWORK(ke)) {
-/* $OpenBSD: tcp_input.c,v 1.291 2015/06/07 01:25:27 krw Exp $ */
+/* $OpenBSD: tcp_input.c,v 1.292 2015/06/07 12:02:28 jsg Exp $ */
/* $NetBSD: tcp_input.c,v 1.23 1996/02/13 23:43:44 christos Exp $ */
/*
mss = IN6_LINKMTU(ifp);
iphlen = sizeof(struct ip6_hdr);
break;
-#endif
+#endif
+ default:
+ unhandled_af(af);
}
mss = mss - iphlen - sizeof(struct tcphdr);
return (max(mss, tcp_mssdflt));
break;
#endif
default:
- th = NULL;
+ unhandled_af(sc->sc_src.sa.sa_family);
}
th->th_seq = htonl(sc->sc_iss);
-/* $OpenBSD: tcp_usrreq.c,v 1.124 2015/06/07 01:25:27 krw Exp $ */
+/* $OpenBSD: tcp_usrreq.c,v 1.125 2015/06/07 12:02:28 jsg Exp $ */
/* $NetBSD: tcp_usrreq.c,v 1.20 1996/02/13 23:44:16 christos Exp $ */
/*
inp = in_pcbhashlookup(&tcbtable, fin->sin_addr,
fin->sin_port, lin->sin_addr, lin->sin_port, tir.rdomain);
break;
+ default:
+ unhandled_af(tir.faddr.ss_family);
}
if (dodrop) {