-/* $OpenBSD: if_gre.c,v 1.112 2018/02/22 09:47:12 dlg Exp $ */
+/* $OpenBSD: if_gre.c,v 1.113 2018/02/24 07:20:04 dlg Exp $ */
/* $NetBSD: if_gre.c,v 1.9 1999/10/25 19:18:11 drochner Exp $ */
/*
return;
}
- memcpy(&nv->nv_dst, eh->ether_shost, ETHER_ADDR_LEN);
memcpy(&nv->nv_dst, eh->ether_shost, ETHER_ADDR_LEN);
nv->nv_type = NVGRE_ENTRY_DYNAMIC;
nv->nv_gateway = key->t_dst;
static inline int
nvgre_entry_cmp(const struct nvgre_entry *a, const struct nvgre_entry *b)
{
- return (memcmp(&a->nv_dst, &a->nv_dst, sizeof(a->nv_dst)));
+ return (memcmp(&a->nv_dst, &b->nv_dst, sizeof(a->nv_dst)));
}
RBT_GENERATE(nvgre_map, nvgre_entry, nv_entry, nvgre_entry_cmp);
-/* $OpenBSD: if_tun.c,v 1.180 2018/01/09 15:24:24 bluhm Exp $ */
+/* $OpenBSD: if_tun.c,v 1.181 2018/02/24 07:20:04 dlg Exp $ */
/* $NetBSD: if_tun.c,v 1.24 1996/05/07 02:40:48 thorpej Exp $ */
/*
struct proc *p)
{
struct tuninfo *tunp;
- struct mbuf *m;
switch (cmd) {
case TUNSIFINFO:
tp->tun_flags &= ~TUN_ASYNC;
break;
case FIONREAD:
- m = ifq_deq_begin(&tp->tun_if.if_snd);
- if (m != NULL) {
- *(int *)data = m->m_pkthdr.len;
- ifq_deq_rollback(&tp->tun_if.if_snd, m);
- } else
- *(int *)data = 0;
+ *(int *)data = ifq_empty(&tp->tun_if.if_snd) ?
+ 0 : tp->tun_if.if_mtu;
break;
case TIOCSPGRP:
tp->tun_pgid = *(int *)data;