Module Name:    src
Committed By:   christos
Date:           Sun Nov 19 16:59:25 UTC 2017

Modified Files:
        src/sys/net: if.c

Log Message:
remove useless cast, initialize family.


To generate a diff of this commit:
cvs rdiff -u -r1.397 -r1.398 src/sys/net/if.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/net/if.c
diff -u src/sys/net/if.c:1.397 src/sys/net/if.c:1.398
--- src/sys/net/if.c:1.397	Fri Nov 17 02:37:12 2017
+++ src/sys/net/if.c	Sun Nov 19 11:59:25 2017
@@ -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 @@ if_dl_create(const struct ifnet *ifp, co
 	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;

Reply via email to