Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sbin/route route: Enable receive error reporting on the rout...
details: https://anonhg.NetBSD.org/src/rev/aaea135a4e5f
branches: trunk
changeset: 1008214:aaea135a4e5f
user: roy <roy%NetBSD.org@localhost>
date: Sat Mar 14 22:26:39 2020 +0000
description:
route: Enable receive error reporting on the routing socket
diffstat:
sbin/route/route.c | 12 +++++++++---
1 files changed, 9 insertions(+), 3 deletions(-)
diffs (34 lines):
diff -r 5fb53e750ee3 -r aaea135a4e5f sbin/route/route.c
--- a/sbin/route/route.c Sat Mar 14 22:23:17 2020 +0000
+++ b/sbin/route/route.c Sat Mar 14 22:26:39 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: route.c,v 1.166 2020/02/22 00:42:15 kamil Exp $ */
+/* $NetBSD: route.c,v 1.167 2020/03/14 22:26:39 roy Exp $ */
/*
* Copyright (c) 1983, 1989, 1991, 1993
@@ -39,7 +39,7 @@
#if 0
static char sccsid[] = "@(#)route.c 8.6 (Berkeley) 4/28/95";
#else
-__RCSID("$NetBSD: route.c,v 1.166 2020/02/22 00:42:15 kamil Exp $");
+__RCSID("$NetBSD: route.c,v 1.167 2020/03/14 22:26:39 roy Exp $");
#endif
#endif /* not lint */
@@ -208,8 +208,14 @@
pid = prog_getpid();
if (tflag)
sock = prog_open("/dev/null", O_WRONLY, 0);
- else
+ else {
+ int on = 1;
+
sock = prog_socket(PF_ROUTE, SOCK_RAW, 0);
+ if (setsockopt(sock, SOL_SOCKET, SO_RERROR,
+ &on, sizeof(on)) == -1)
+ warn("SO_RERROR");
+ }
if (sock < 0)
err(EXIT_FAILURE, "socket");
Home |
Main Index |
Thread Index |
Old Index