Source-Changes-HG archive

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

[src/trunk]: src/sys Fix token_rif extractions from llentry



details:   https://anonhg.NetBSD.org/src/rev/bfb1018a3be2
branches:  trunk
changeset: 342307:bfb1018a3be2
user:      ozaki-r <ozaki-r%NetBSD.org@localhost>
date:      Wed Dec 16 05:44:59 2015 +0000

description:
Fix token_rif extractions from llentry

diffstat:

 sys/net/if_token.h     |  8 +++++---
 sys/net/if_tokensubr.c |  8 ++++----
 sys/netinet/if_arp.c   |  6 +++---
 3 files changed, 12 insertions(+), 10 deletions(-)

diffs (81 lines):

diff -r ddecc0654601 -r bfb1018a3be2 sys/net/if_token.h
--- a/sys/net/if_token.h        Wed Dec 16 03:24:29 2015 +0000
+++ b/sys/net/if_token.h        Wed Dec 16 05:44:59 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_token.h,v 1.16 2008/02/20 17:05:53 matt Exp $       */
+/*     $NetBSD: if_token.h,v 1.17 2015/12/16 05:44:59 ozaki-r Exp $    */
 
 /*
  * Copyright (c) 1982, 1986, 1993
@@ -95,11 +95,13 @@
 #define ISO88025_MTU 2002
 
 /*
- * This assumes that route information fields are appended to
- * existing structures like llinfo_arp and token_header
+ * This assumes that route information fields are appended to token_header.
  */
 #define TOKEN_RIF(x) ((struct token_rif *) ((x) + 1))
 
+#define TOKEN_RIF_LLE(lle) ((struct token_rif *) (lle)->la_opaque)
+#define TOKEN_RIF_LLE_ASSERT(lle) KASSERT((lle)->la_opaque != NULL)
+
 /*
  * This is a kludge to get at the token ring mac header and the source route
  * information after m_adj() has been used on the mbuf.
diff -r ddecc0654601 -r bfb1018a3be2 sys/net/if_tokensubr.c
--- a/sys/net/if_tokensubr.c    Wed Dec 16 03:24:29 2015 +0000
+++ b/sys/net/if_tokensubr.c    Wed Dec 16 05:44:59 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_tokensubr.c,v 1.71 2015/08/31 08:05:20 ozaki-r Exp $        */
+/*     $NetBSD: if_tokensubr.c,v 1.72 2015/12/16 05:44:59 ozaki-r Exp $        */
 
 /*
  * Copyright (c) 1982, 1989, 1993
@@ -92,7 +92,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_tokensubr.c,v 1.71 2015/08/31 08:05:20 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_tokensubr.c,v 1.72 2015/12/16 05:44:59 ozaki-r Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -223,8 +223,8 @@
                                return (0);     /* if not yet resolved */
                        la = rt->rt_llinfo;
                        KASSERT(la != NULL);
-                       KASSERT(la->la_opaque != NULL);
-                       rif = la->la_opaque;
+                       TOKEN_RIF_LLE_ASSERT(la);
+                       rif = TOKEN_RIF_LLE(la);
                        riflen = (ntohs(rif->tr_rcf) & TOKEN_RCF_LEN_MASK) >> 8;
                }
                /* If broadcasting on a simplex interface, loopback a copy. */
diff -r ddecc0654601 -r bfb1018a3be2 sys/netinet/if_arp.c
--- a/sys/netinet/if_arp.c      Wed Dec 16 03:24:29 2015 +0000
+++ b/sys/netinet/if_arp.c      Wed Dec 16 05:44:59 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_arp.c,v 1.196 2015/12/11 01:15:00 ozaki-r Exp $     */
+/*     $NetBSD: if_arp.c,v 1.197 2015/12/16 05:44:59 ozaki-r Exp $     */
 
 /*-
  * Copyright (c) 1998, 2000, 2008 The NetBSD Foundation, Inc.
@@ -68,7 +68,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_arp.c,v 1.196 2015/12/11 01:15:00 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_arp.c,v 1.197 2015/12/16 05:44:59 ozaki-r Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_ddb.h"
@@ -1336,7 +1336,7 @@
                            (riflen & 1) == 0) {
                                rif->tr_rcf ^= htons(TOKEN_RCF_DIRECTION);
                                rif->tr_rcf &= htons(~TOKEN_RCF_BROADCAST_MASK);
-                               memcpy(TOKEN_RIF(la), rif, riflen);
+                               memcpy(TOKEN_RIF_LLE(la), rif, riflen);
                        }
                }
        }



Home | Main Index | Thread Index | Old Index