Author: bz
Date: Thu May 24 16:30:13 2012
New Revision: 235916
URL: http://svn.freebsd.org/changeset/base/235916

Log:
  MFp4 bz_ipv6_fast:
  
    Introduce in6_getscope() to allow more effective checksum
    computations without the need to copy the address to clear the
    scope.
  
    Sponsored by:       The FreeBSD Foundation
    Sponsored by:       iXsystems
  
  Reviewed by:  gnn (as part of the whole)
  MFC After:    3 days

Modified:
  head/sys/netinet6/scope6.c
  head/sys/netinet6/scope6_var.h

Modified: head/sys/netinet6/scope6.c
==============================================================================
--- head/sys/netinet6/scope6.c  Thu May 24 16:11:51 2012        (r235915)
+++ head/sys/netinet6/scope6.c  Thu May 24 16:30:13 2012        (r235916)
@@ -494,3 +494,16 @@ in6_clearscope(struct in6_addr *in6)
 
        return (modified);
 }
+
+/*
+ * Return the scope identifier or zero.
+ */
+uint16_t
+in6_getscope(struct in6_addr *in6)
+{
+
+       if (IN6_IS_SCOPE_LINKLOCAL(in6) || IN6_IS_ADDR_MC_INTFACELOCAL(in6))
+               return (in6->s6_addr16[1]);
+
+       return (0);
+}

Modified: head/sys/netinet6/scope6_var.h
==============================================================================
--- head/sys/netinet6/scope6_var.h      Thu May 24 16:11:51 2012        
(r235915)
+++ head/sys/netinet6/scope6_var.h      Thu May 24 16:30:13 2012        
(r235916)
@@ -54,6 +54,7 @@ int   sa6_embedscope __P((struct sockaddr_
 int    sa6_recoverscope __P((struct sockaddr_in6 *));
 int    in6_setscope __P((struct in6_addr *, struct ifnet *, u_int32_t *));
 int    in6_clearscope __P((struct in6_addr *));
+uint16_t in6_getscope(struct in6_addr *);
 #endif /* _KERNEL */
 
 #endif /* _NETINET6_SCOPE6_VAR_H_ */
_______________________________________________
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to