Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys use satosin{,6} macros instead of casts.
details: https://anonhg.NetBSD.org/src/rev/e0797d3e79db
branches: trunk
changeset: 342502:e0797d3e79db
user: knakahara <knakahara%NetBSD.org@localhost>
date: Fri Dec 25 06:47:56 2015 +0000
description:
use satosin{,6} macros instead of casts.
diffstat:
sys/netinet/in_gif.c | 12 ++++++------
sys/netinet6/in6_gif.c | 12 ++++++------
2 files changed, 12 insertions(+), 12 deletions(-)
diffs (80 lines):
diff -r b408a26fb510 -r e0797d3e79db sys/netinet/in_gif.c
--- a/sys/netinet/in_gif.c Fri Dec 25 06:03:06 2015 +0000
+++ b/sys/netinet/in_gif.c Fri Dec 25 06:47:56 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: in_gif.c,v 1.66 2015/12/11 07:59:14 knakahara Exp $ */
+/* $NetBSD: in_gif.c,v 1.67 2015/12/25 06:47:56 knakahara Exp $ */
/* $KAME: in_gif.c,v 1.66 2001/07/29 04:46:09 itojun Exp $ */
/*
@@ -31,7 +31,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: in_gif.c,v 1.66 2015/12/11 07:59:14 knakahara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: in_gif.c,v 1.67 2015/12/25 06:47:56 knakahara Exp $");
#ifdef _KERNEL_OPT
#include "opt_inet.h"
@@ -96,8 +96,8 @@
{
struct rtentry *rt;
struct gif_softc *sc = ifp->if_softc;
- struct sockaddr_in *sin_src = (struct sockaddr_in *)sc->gif_psrc;
- struct sockaddr_in *sin_dst = (struct sockaddr_in *)sc->gif_pdst;
+ struct sockaddr_in *sin_src = satosin(sc->gif_psrc);
+ struct sockaddr_in *sin_dst = satosin(sc->gif_pdst);
struct ip iphdr; /* capsule IP header, host byte ordered */
int proto, error;
u_int8_t tos;
@@ -297,8 +297,8 @@
struct sockaddr_in *src, *dst;
struct in_ifaddr *ia4;
- src = (struct sockaddr_in *)sc->gif_psrc;
- dst = (struct sockaddr_in *)sc->gif_pdst;
+ src = satosin(sc->gif_psrc);
+ dst = satosin(sc->gif_pdst);
/* check for address match */
if (src->sin_addr.s_addr != ip->ip_dst.s_addr ||
diff -r b408a26fb510 -r e0797d3e79db sys/netinet6/in6_gif.c
--- a/sys/netinet6/in6_gif.c Fri Dec 25 06:03:06 2015 +0000
+++ b/sys/netinet6/in6_gif.c Fri Dec 25 06:47:56 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: in6_gif.c,v 1.63 2015/12/11 07:59:14 knakahara Exp $ */
+/* $NetBSD: in6_gif.c,v 1.64 2015/12/25 06:47:57 knakahara Exp $ */
/* $KAME: in6_gif.c,v 1.62 2001/07/29 04:27:25 itojun Exp $ */
/*
@@ -31,7 +31,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: in6_gif.c,v 1.63 2015/12/11 07:59:14 knakahara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: in6_gif.c,v 1.64 2015/12/25 06:47:57 knakahara Exp $");
#ifdef _KERNEL_OPT
#include "opt_inet.h"
@@ -90,8 +90,8 @@
{
struct rtentry *rt;
struct gif_softc *sc = ifp->if_softc;
- struct sockaddr_in6 *sin6_src = (struct sockaddr_in6 *)sc->gif_psrc;
- struct sockaddr_in6 *sin6_dst = (struct sockaddr_in6 *)sc->gif_pdst;
+ struct sockaddr_in6 *sin6_src = satosin6(sc->gif_psrc);
+ struct sockaddr_in6 *sin6_dst = satosin6(sc->gif_pdst);
struct ip6_hdr *ip6;
int proto, error;
u_int8_t itos, otos;
@@ -300,8 +300,8 @@
{
const struct sockaddr_in6 *src, *dst;
- src = (struct sockaddr_in6 *)sc->gif_psrc;
- dst = (struct sockaddr_in6 *)sc->gif_pdst;
+ src = satosin6(sc->gif_psrc);
+ dst = satosin6(sc->gif_pdst);
/* check for address match */
if (!IN6_ARE_ADDR_EQUAL(&src->sin6_addr, &ip6->ip6_dst) ||
Home |
Main Index |
Thread Index |
Old Index