summaryrefslogtreecommitdiffstats
path: root/sys/netinet/tcp_input.c
diff options
context:
space:
mode:
authorjsg <jsg@openbsd.org>2015-06-07 12:02:28 +0000
committerjsg <jsg@openbsd.org>2015-06-07 12:02:28 +0000
commitba4138390b9fd1585b0009db6ac54b8875efca33 (patch)
tree8ed1945da6446c80011c2b98506c873a9d57fff9 /sys/netinet/tcp_input.c
parentmark the usb hci driver pci glue code as only needed by the pci attachment, (diff)
downloadwireguard-openbsd-ba4138390b9fd1585b0009db6ac54b8875efca33.tar.xz
wireguard-openbsd-ba4138390b9fd1585b0009db6ac54b8875efca33.zip
Introduce unhandled_af() for cases where code conditionally does
something based on an address family and later assumes one of the paths was taken. This was initially just calls to panic until guenther suggested a function to reduce the amount of strings needed. This reduces the amount of noise with static analysers and acts as a sanity check. ok guenther@ bluhm@
Diffstat (limited to 'sys/netinet/tcp_input.c')
-rw-r--r--sys/netinet/tcp_input.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c
index 6a6db0ea0e1..15e69aead3a 100644
--- a/sys/netinet/tcp_input.c
+++ b/sys/netinet/tcp_input.c
@@ -1,4 +1,4 @@
-/* $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 $ */
/*
@@ -3262,7 +3262,9 @@ tcp_mss_adv(struct ifnet *ifp, int af)
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));
@@ -4203,7 +4205,7 @@ syn_cache_respond(struct syn_cache *sc, struct mbuf *m)
break;
#endif
default:
- th = NULL;
+ unhandled_af(sc->sc_src.sa.sa_family);
}
th->th_seq = htonl(sc->sc_iss);