Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/net remove useless cast, initialize family.
details: https://anonhg.NetBSD.org/src/rev/d4f2be5dfa46
branches: trunk
changeset: 357643:d4f2be5dfa46
user: christos <christos%NetBSD.org@localhost>
date: Sun Nov 19 16:59:25 2017 +0000
description:
remove useless cast, initialize family.
diffstat:
sys/net/if.c | 7 ++++---
1 files changed, 4 insertions(+), 3 deletions(-)
diffs (34 lines):
diff -r 39c36121799c -r d4f2be5dfa46 sys/net/if.c
--- a/sys/net/if.c Sun Nov 19 14:03:35 2017 +0000
+++ b/sys/net/if.c Sun Nov 19 16:59:25 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if.c,v 1.397 2017/11/17 07:37:12 ozaki-r Exp $ */
+/* $NetBSD: if.c,v 1.398 2017/11/19 16:59:25 christos Exp $ */
/*-
* Copyright (c) 1999, 2000, 2001, 2008 The NetBSD Foundation, Inc.
@@ -90,7 +90,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if.c,v 1.397 2017/11/17 07:37:12 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if.c,v 1.398 2017/11/19 16:59:25 christos Exp $");
#if defined(_KERNEL_OPT)
#include "opt_inet.h"
@@ -447,13 +447,14 @@
addrlen = ifp->if_addrlen;
socksize = roundup(sockaddr_dl_measure(namelen, addrlen), sizeof(long));
ifasize = sizeof(*ifa) + 2 * socksize;
- ifa = (struct ifaddr *)malloc(ifasize, M_IFADDR, M_WAITOK|M_ZERO);
+ ifa = malloc(ifasize, M_IFADDR, M_WAITOK|M_ZERO);
sdl = (struct sockaddr_dl *)(ifa + 1);
mask = (struct sockaddr_dl *)(socksize + (char *)sdl);
sockaddr_dl_init(sdl, socksize, ifp->if_index, ifp->if_type,
ifp->if_xname, namelen, NULL, addrlen);
+ mask->sdl_family = AF_LINK;
mask->sdl_len = sockaddr_dl_measure(namelen, 0);
memset(&mask->sdl_data[0], 0xff, namelen);
ifa->ifa_rtrequest = link_rtrequest;
Home |
Main Index |
Thread Index |
Old Index