-/* $OpenBSD: rebound.c,v 1.7 2015/10/15 21:25:05 tedu Exp $ */
+/* $OpenBSD: rebound.c,v 1.8 2015/10/15 21:35:27 tedu Exp $ */
/*
* Copyright (c) 2015 Ted Unangst <tedu@openbsd.org>
*
}
req->cacheent = hit;
- req->s = socket(AF_INET, SOCK_DGRAM, 0);
+ req->s = socket(remoteaddr->sa_family, SOCK_DGRAM, 0);
if (req->s == -1)
goto fail;
if (connect(req->s, remoteaddr, remoteaddr->sa_len) == -1) {
if (req->client == -1)
goto fail;
- req->s = socket(AF_INET, SOCK_STREAM, 0);
+ req->s = socket(remoteaddr->sa_family, SOCK_STREAM, 0);
if (req->s == -1)
goto fail;
if (connect(req->s, remoteaddr, remoteaddr->sa_len) == -1)