-/* $OpenBSD: l2tpd.c,v 1.15 2014/05/07 01:16:15 tedu Exp $ */
+/* $OpenBSD: l2tpd.c,v 1.16 2015/06/23 06:59:54 yasuoka Exp $ */
/*-
* Copyright (c) 2009 Internet Initiative Japan Inc.
* SUCH DAMAGE.
*/
/**@file L2TP(Layer Two Tunneling Protocol "L2TP") / RFC2661 */
-/* $Id: l2tpd.c,v 1.15 2014/05/07 01:16:15 tedu Exp $ */
+/* $Id: l2tpd.c,v 1.16 2015/06/23 06:59:54 yasuoka Exp $ */
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/time.h>
if ((sz = recvfromto(_this->sock, buf,
sizeof(buf), 0,
(struct sockaddr *)&peer, &peerlen,
- (struct sockaddr *)&sock, &socklen)) <= 0) {
+ (struct sockaddr *)&sock, &socklen)) == -1) {
#endif
if (errno == EAGAIN || errno == EINTR)
break;
-/* $OpenBSD: pptpd.c,v 1.25 2015/01/19 01:48:59 deraadt Exp $ */
+/* $OpenBSD: pptpd.c,v 1.26 2015/06/23 06:59:54 yasuoka Exp $ */
/*-
* Copyright (c) 2009 Internet Initiative Japan Inc.
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
-/* $Id: pptpd.c,v 1.25 2015/01/19 01:48:59 deraadt Exp $ */
+/* $Id: pptpd.c,v 1.26 2015/06/23 06:59:54 yasuoka Exp $ */
/**@file
* This file provides a implementation of PPTP daemon. Currently it
* provides functions for PAC (PPTP Access Concentrator) only.
- * $Id: pptpd.c,v 1.25 2015/01/19 01:48:59 deraadt Exp $
+ * $Id: pptpd.c,v 1.26 2015/06/23 06:59:54 yasuoka Exp $
*/
#include <sys/types.h>
#include <sys/socket.h>
/* read till bloked */
peerlen = sizeof(peer);
if ((sz = recvfrom(listener->sock_gre, pkt, sizeof(pkt),
- 0, (struct sockaddr *)&peer, &peerlen)) <= 0) {
- if (sz < 0 &&
- (errno == EAGAIN || errno == EINTR))
+ 0, (struct sockaddr *)&peer, &peerlen)) == -1) {
+ if (errno == EAGAIN || errno == EINTR)
break;
pptpd_log(_this, LOG_INFO,
"read(GRE) failed: %m");