summaryrefslogtreecommitdiffstats
path: root/sys/net/if_fddisubr.c
diff options
context:
space:
mode:
authormsmith <msmith@FreeBSD.org>1999-10-15 05:07:00 +0000
committermsmith <msmith@FreeBSD.org>1999-10-15 05:07:00 +0000
commit010a32d6458bd7e412e002c28e3878b4705e31d4 (patch)
treec7ec9ce93e079a077a5d74249290ab77984e574c /sys/net/if_fddisubr.c
parentd21234b78cc7e611247dffae6bf6c15ac69b667a (diff)
downloadFreeBSD-src-010a32d6458bd7e412e002c28e3878b4705e31d4.zip
FreeBSD-src-010a32d6458bd7e412e002c28e3878b4705e31d4.tar.gz
Implement pseudo_AF_HDRCMPLT, which controls the state of the 'header
completion' flag. If set, the interface output routine will assume that the packet already has a valid link-level source address. This defaults to off (the address is overwritten) PR: kern/10680 Submitted by: "Christopher N . Harrell" <cnh@mindspring.net> Obtained from: NetBSD
Diffstat (limited to 'sys/net/if_fddisubr.c')
-rw-r--r--sys/net/if_fddisubr.c22
1 files changed, 17 insertions, 5 deletions
diff --git a/sys/net/if_fddisubr.c b/sys/net/if_fddisubr.c
index 25409fd..eedc822 100644
--- a/sys/net/if_fddisubr.c
+++ b/sys/net/if_fddisubr.c
@@ -136,8 +136,8 @@ fddi_output(ifp, m0, dst, rt0)
struct rtentry *rt0;
{
u_int16_t type;
- int s, loop_copy = 0, error = 0;
- u_char edst[6];
+ int s, loop_copy = 0, error = 0, hdrcmplt = 0;
+ u_char esrc[6], edst[6];
register struct mbuf *m = m0;
register struct rtentry *rt;
register struct fddi_header *fh;
@@ -295,6 +295,15 @@ fddi_output(ifp, m0, dst, rt0)
} break;
#endif /* LLC */
+ case pseudo_AF_HDRCMPLT:
+ {
+ struct ether_header *eh;
+ hdrcmplt = 1;
+ eh = (struct ether_header *)dst->sa_data;
+ (void)memcpy((caddr_t)esrc, (caddr_t)eh->ether_shost, sizeof (esrc));
+ /* FALLTHROUGH */
+ }
+
case AF_UNSPEC:
{
struct ether_header *eh;
@@ -370,9 +379,12 @@ fddi_output(ifp, m0, dst, rt0)
fh->fddi_fc = FDDIFC_LLC_ASYNC|FDDIFC_LLC_PRIO4;
(void)memcpy((caddr_t)fh->fddi_dhost, (caddr_t)edst, sizeof (edst));
queue_it:
- (void)memcpy((caddr_t)fh->fddi_shost, (caddr_t)ac->ac_enaddr,
- sizeof(fh->fddi_shost));
-
+ if (hdrcmplt)
+ (void)memcpy((caddr_t)fh->fddi_shost, (caddr_t)esrc,
+ sizeof(fh->fddi_shost));
+ else
+ (void)memcpy((caddr_t)fh->fddi_shost, (caddr_t)ac->ac_enaddr,
+ sizeof(fh->fddi_shost));
/*
* If a simplex interface, and the packet is being sent to our
* Ethernet address or a broadcast address, loopback a copy.
OpenPOWER on IntegriCloud