Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys Don't assume the Token-Ring source route is in the m_pkt...



details:   https://anonhg.NetBSD.org/src/rev/e19f3e3a9527
branches:  trunk
changeset: 473341:e19f3e3a9527
user:      bad <bad%NetBSD.org@localhost>
date:      Sat May 29 22:36:07 1999 +0000

description:
Don't assume the Token-Ring source route is in the m_pktdat.  Use
m_data instead.  This isn't a problem with ARP packets but is correct
way to this.

Noticed by pmara%cactus.org@localhost (Shashi Mara).

diffstat:

 sys/net/if_tokensubr.c |  6 +++---
 sys/netinet/if_arp.c   |  8 ++++----
 2 files changed, 7 insertions(+), 7 deletions(-)

diffs (55 lines):

diff -r 0f44b64fe7af -r e19f3e3a9527 sys/net/if_tokensubr.c
--- a/sys/net/if_tokensubr.c    Sat May 29 21:10:43 1999 +0000
+++ b/sys/net/if_tokensubr.c    Sat May 29 22:36:07 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_tokensubr.c,v 1.5 1999/05/18 23:57:21 thorpej Exp $ */
+/*     $NetBSD: if_tokensubr.c,v 1.6 1999/05/29 22:36:07 bad Exp $     */
 
 /*
  * Copyright (c) 1997-1999
@@ -214,7 +214,7 @@
                break;
        case AF_ARP:
 /*
- * XXX source routing, assume m->pktdat contains the useful stuff
+ * XXX source routing, assume m->m_data contains the useful stuff
  */
                ah = mtod(m, struct arphdr *);
                ah->ar_hrd = htons(ARPHRD_IEEE802);
@@ -245,7 +245,7 @@
                }
                else {
                        bcopy((caddr_t)ar_tha(ah), (caddr_t)edst, sizeof(edst));
-                       trh = (struct token_header *) m->m_pktdat;
+                       trh = mtod(m, struct token_header *);
                        trh->token_ac = TOKEN_AC;
                        trh->token_fc = TOKEN_FC;
                        if (trh->token_shost[0] & TOKEN_RI_PRESENT) {
diff -r 0f44b64fe7af -r e19f3e3a9527 sys/netinet/if_arp.c
--- a/sys/netinet/if_arp.c      Sat May 29 21:10:43 1999 +0000
+++ b/sys/netinet/if_arp.c      Sat May 29 22:36:07 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_arp.c,v 1.59 1999/05/23 20:21:51 ad Exp $   */
+/*     $NetBSD: if_arp.c,v 1.60 1999/05/29 22:36:08 bad Exp $  */
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -639,15 +639,15 @@
                }
 #if NTOKEN > 0
                /*
-                * XXX uses m_pktdat and assumes the complete answer including
+                * XXX uses m_data and assumes the complete answer including
                 * XXX token-ring headers is in the same buf
                 */
                if (ifp->if_type == IFT_ISO88025 &&
-                       m->m_pktdat[8] & TOKEN_RI_PRESENT) {
+                       m->m_data[8] & TOKEN_RI_PRESENT) {
                        struct token_rif        *rif;
                        size_t  riflen;
 
-                       rif = TOKEN_RIF((struct token_header *) m->m_pktdat);
+                       rif = TOKEN_RIF(mtod(m, struct token_header *));
                        riflen = (ntohs(rif->tr_rcf) & TOKEN_RCF_LEN_MASK) >> 8;
 
                        if (riflen > 2 && riflen < sizeof(struct token_rif) &&



Home | Main Index | Thread Index | Old Index