summaryrefslogtreecommitdiffstats
path: root/sys/dev
diff options
context:
space:
mode:
authorbrad <brad@openbsd.org>2006-01-14 09:50:20 +0000
committerbrad <brad@openbsd.org>2006-01-14 09:50:20 +0000
commit81652a7199d59be3493592ce45bcbccb7564206b (patch)
treee642370f5ff9ecf0d97d37bd16907cd249d86bc2 /sys/dev
parentdocument why we avoid: set -- `getopt optstring $*` (diff)
downloadwireguard-openbsd-81652a7199d59be3493592ce45bcbccb7564206b.tar.xz
wireguard-openbsd-81652a7199d59be3493592ce45bcbccb7564206b.zip
- the allmulti target initially enables all multicast mode so don't bother
checking the IFF_ALLMULTI flag. - clean up vr_encap() a bit. From: Andrey Matveev <evol at online dot ptt dot ru>
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/pci/if_vr.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/sys/dev/pci/if_vr.c b/sys/dev/pci/if_vr.c
index f825d8fefd8..264764e2fa1 100644
--- a/sys/dev/pci/if_vr.c
+++ b/sys/dev/pci/if_vr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_vr.c,v 1.54 2005/12/10 18:34:11 krw Exp $ */
+/* $OpenBSD: if_vr.c,v 1.55 2006/01/14 09:50:20 brad Exp $ */
/*
* Copyright (c) 1997, 1998
@@ -490,8 +490,8 @@ vr_setmulti(struct vr_softc *sc)
rxfilt = CSR_READ_1(sc, VR_RXCFG);
-allmulti:
if (ifp->if_flags & IFF_ALLMULTI || ifp->if_flags & IFF_PROMISC) {
+allmulti:
rxfilt |= VR_RXCFG_RX_MULTI;
CSR_WRITE_1(sc, VR_RXCFG, rxfilt);
CSR_WRITE_4(sc, VR_MAR0, 0xFFFFFFFF);
@@ -1286,15 +1286,16 @@ vr_encap(struct vr_softc *sc, struct vr_chain *c, struct mbuf *m_head)
m_freem(m_head);
+ c->vr_mbuf = m_new;
+
f = c->vr_ptr;
f->vr_data = htole32(c->vr_map->dm_segs[0].ds_addr);
f->vr_ctl = htole32(c->vr_map->dm_mapsize);
f->vr_ctl |= htole32(VR_TXCTL_TLINK|VR_TXCTL_FIRSTFRAG);
f->vr_status = htole32(0);
- c->vr_mbuf = m_new;
- c->vr_ptr->vr_ctl |= htole32(VR_TXCTL_LASTFRAG|VR_TXCTL_FINT);
- c->vr_ptr->vr_next = htole32(c->vr_nextdesc->vr_paddr);
+ f->vr_ctl |= htole32(VR_TXCTL_LASTFRAG|VR_TXCTL_FINT);
+ f->vr_next = htole32(c->vr_nextdesc->vr_paddr);
return (0);
}