summaryrefslogtreecommitdiff
path: root/sys/net/if_gre.c
diff options
context:
space:
mode:
authorDavid Gwynne <dlg@cvs.openbsd.org>2018-10-18 01:36:27 +0000
committerDavid Gwynne <dlg@cvs.openbsd.org>2018-10-18 01:36:27 +0000
commit7ec27ebf39419a542f233f200b10189edb471ad7 (patch)
treefb0482575bc35590f07db694c560ba141270b8dc /sys/net/if_gre.c
parent8bdde859a6ede9328df1d435ff5b4e45fcbf8503 (diff)
Process incoming gre(4) keepalives early to avoid bpf seeing them.
The packet processing done after the protocol detection effectively gets thrown away by the keepalive handling, so this saves some time, and avoids confusing tcpdump on the interface. Keepalives the driver transmits aren't made available for bpf, so taking it away from the receive side is consistent. discussed with and tested by markus@
Diffstat (limited to 'sys/net/if_gre.c')
-rw-r--r--sys/net/if_gre.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/sys/net/if_gre.c b/sys/net/if_gre.c
index 143db4e39c3..c43344368fb 100644
--- a/sys/net/if_gre.c
+++ b/sys/net/if_gre.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_gre.c,v 1.125 2018/10/16 03:00:27 dlg Exp $ */
+/* $OpenBSD: if_gre.c,v 1.126 2018/10/18 01:36:26 dlg Exp $ */
/* $NetBSD: if_gre.c,v 1.9 1999/10/25 19:18:11 drochner Exp $ */
/*
@@ -1103,11 +1103,9 @@ gre_input_key(struct mbuf **mp, int *offp, int type, int af,
goto decline;
}
-#if NBPFILTER > 0
- bpf_af = AF_UNSPEC;
-#endif
- input = gre_keepalive_recv;
- break;
+ m_adj(m, hlen);
+ gre_keepalive_recv(ifp, m);
+ return (IPPROTO_DONE);
default:
goto decline;