Fix build dependency of if_llatbl.c

if_llatbl.c is required if inet or inet6 is enabled. Depending on ether
doesn't suit for NDP case.
This commit is contained in:
ozaki-r 2015-11-26 01:41:20 +00:00
parent 600fe0a3fe
commit f373fa78e6
4 changed files with 22 additions and 17 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: init_main.c,v 1.474 2015/11/20 18:34:17 christos Exp $ */
/* $NetBSD: init_main.c,v 1.475 2015/11/26 01:41:20 ozaki-r Exp $ */
/*-
* Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
@ -97,9 +97,10 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: init_main.c,v 1.474 2015/11/20 18:34:17 christos Exp $");
__KERNEL_RCSID(0, "$NetBSD: init_main.c,v 1.475 2015/11/26 01:41:20 ozaki-r Exp $");
#include "opt_ddb.h"
#include "opt_inet.h"
#include "opt_ipsec.h"
#include "opt_modular.h"
#include "opt_ntp.h"
@ -121,7 +122,6 @@ extern void *_binary_splash_image_end;
#endif
#include "drvctl.h"
#include "ether.h"
#include "ksyms.h"
#include "veriexec.h"
@ -543,7 +543,7 @@ main(void)
*/
s = splnet();
ifinit();
#if NETHER > 0
#if defined(INET) || defined(INET6)
lltableinit();
#endif
domaininit(true);

View File

@ -1,4 +1,4 @@
# $NetBSD: files.net,v 1.7 2015/08/31 08:02:44 ozaki-r Exp $
# $NetBSD: files.net,v 1.8 2015/11/26 01:41:20 ozaki-r Exp $
# XXX CLEANUP
define net
@ -22,7 +22,7 @@ file net/if_gif.c gif needs-flag
file net/if_gre.c gre needs-flag
file net/if_hippisubr.c hippi needs-flag
file net/if_ieee1394subr.c ieee1394
file net/if_llatbl.c ether
file net/if_llatbl.c inet | inet6
file net/if_loop.c loop
file net/if_media.c net
file net/if_mpls.c ifmpls needs-flag

View File

@ -1,4 +1,4 @@
/* $NetBSD: if_llatbl.c,v 1.8 2015/11/25 06:21:26 ozaki-r Exp $ */
/* $NetBSD: if_llatbl.c,v 1.9 2015/11/26 01:41:20 ozaki-r Exp $ */
/*
* Copyright (c) 2004 Luigi Rizzo, Alessandro Cerri. All rights reserved.
* Copyright (c) 2004-2008 Qing Li. All rights reserved.
@ -35,6 +35,8 @@
#include "opt_inet6.h"
#endif
#include "arp.h"
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/malloc.h>
@ -615,13 +617,15 @@ lla_rt_output(struct rt_msghdr *rtm, struct rt_addrinfo *info)
laflags = lle->la_flags;
LLE_WUNLOCK(lle);
IF_AFDATA_WUNLOCK(ifp);
#ifdef INET
#if defined(INET) && NARP > 0
/* gratuitous ARP */
if ((laflags & LLE_PUB) && dst->sa_family == AF_INET)
arprequest(ifp,
&((const struct sockaddr_in *)dst)->sin_addr,
&((const struct sockaddr_in *)dst)->sin_addr,
CLLADDR(dl));
#else
(void)laflags;
#endif
break;

View File

@ -1,4 +1,4 @@
/* $NetBSD: in.c,v 1.162 2015/11/16 05:39:39 ozaki-r Exp $ */
/* $NetBSD: in.c,v 1.163 2015/11/26 01:41:20 ozaki-r Exp $ */
/*
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@ -91,10 +91,9 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: in.c,v 1.162 2015/11/16 05:39:39 ozaki-r Exp $");
__KERNEL_RCSID(0, "$NetBSD: in.c,v 1.163 2015/11/26 01:41:20 ozaki-r Exp $");
#include "arp.h"
#include "ether.h"
#ifdef _KERNEL_OPT
#include "opt_inet.h"
@ -1536,7 +1535,7 @@ in_selectsrc(struct sockaddr_in *sin, struct route *ro,
return satosin(&ia->ia_addr);
}
#if NETHER > 0
#if NARP > 0
struct in_llentry {
struct llentry base;
@ -1856,7 +1855,7 @@ in_lltable_lookup(struct lltable *llt, u_int flags, const struct sockaddr *l3add
return lle;
}
#endif /* NETHER > 0 */
#endif /* NARP > 0 */
static void
in_sysctl_init(struct sysctllog **clog)
@ -1891,7 +1890,8 @@ in_sysctl_init(struct sysctllog **clog)
IPCTL_HOSTZEROBROADCAST, CTL_EOL);
}
#if NETHER > 0
#if NARP > 0
static struct lltable *
in_lltattach(struct ifnet *ifp)
{
@ -1915,7 +1915,8 @@ in_lltattach(struct ifnet *ifp)
return (llt);
}
#endif /* NETHER > 0 */
#endif /* NARP > 0 */
void *
in_domifattach(struct ifnet *ifp)
@ -1925,7 +1926,7 @@ in_domifattach(struct ifnet *ifp)
ii = kmem_zalloc(sizeof(struct in_ifinfo), KM_SLEEP);
KASSERT(ii != NULL);
#if NETHER > 0
#if NARP > 0
ii->ii_llt = in_lltattach(ifp);
#endif
@ -1945,7 +1946,7 @@ in_domifdetach(struct ifnet *ifp, void *aux)
#ifdef IPSELSRC
in_selsrc_domifdetach(ifp, ii->ii_selsrc);
#endif
#if NETHER > 0
#if NARP > 0
lltable_free(ii->ii_llt);
#endif
kmem_free(ii, sizeof(struct in_ifinfo));