ipv6: use IS_ENABLED()
#if defined(CONFIG_FOO) || defined(CONFIG_FOO_MODULE) can be replaced by #if IS_ENABLED(CONFIG_FOO) Cc: David S. Miller <davem@davemloft.net> Signed-off-by: Cong Wang <amwang@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
cc535dfb6a
commit
07a936260a
|
@ -402,7 +402,7 @@ static struct inet6_dev *ipv6_add_dev(struct net_device *dev)
|
||||||
if (dev->flags & (IFF_NOARP | IFF_LOOPBACK))
|
if (dev->flags & (IFF_NOARP | IFF_LOOPBACK))
|
||||||
ndev->cnf.accept_dad = -1;
|
ndev->cnf.accept_dad = -1;
|
||||||
|
|
||||||
#if defined(CONFIG_IPV6_SIT) || defined(CONFIG_IPV6_SIT_MODULE)
|
#if IS_ENABLED(CONFIG_IPV6_SIT)
|
||||||
if (dev->type == ARPHRD_SIT && (dev->priv_flags & IFF_ISATAP)) {
|
if (dev->type == ARPHRD_SIT && (dev->priv_flags & IFF_ISATAP)) {
|
||||||
pr_info("%s: Disabled Multicast RS\n", dev->name);
|
pr_info("%s: Disabled Multicast RS\n", dev->name);
|
||||||
ndev->cnf.rtr_solicits = 0;
|
ndev->cnf.rtr_solicits = 0;
|
||||||
|
@ -1838,7 +1838,7 @@ addrconf_prefix_route(struct in6_addr *pfx, int plen, struct net_device *dev,
|
||||||
This thing is done here expecting that the whole
|
This thing is done here expecting that the whole
|
||||||
class of non-broadcast devices need not cloning.
|
class of non-broadcast devices need not cloning.
|
||||||
*/
|
*/
|
||||||
#if defined(CONFIG_IPV6_SIT) || defined(CONFIG_IPV6_SIT_MODULE)
|
#if IS_ENABLED(CONFIG_IPV6_SIT)
|
||||||
if (dev->type == ARPHRD_SIT && (dev->flags & IFF_POINTOPOINT))
|
if (dev->type == ARPHRD_SIT && (dev->flags & IFF_POINTOPOINT))
|
||||||
cfg.fc_flags |= RTF_NONEXTHOP;
|
cfg.fc_flags |= RTF_NONEXTHOP;
|
||||||
#endif
|
#endif
|
||||||
|
@ -1898,7 +1898,7 @@ static void addrconf_add_mroute(struct net_device *dev)
|
||||||
ip6_route_add(&cfg);
|
ip6_route_add(&cfg);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(CONFIG_IPV6_SIT) || defined(CONFIG_IPV6_SIT_MODULE)
|
#if IS_ENABLED(CONFIG_IPV6_SIT)
|
||||||
static void sit_route_add(struct net_device *dev)
|
static void sit_route_add(struct net_device *dev)
|
||||||
{
|
{
|
||||||
struct fib6_config cfg = {
|
struct fib6_config cfg = {
|
||||||
|
@ -2250,7 +2250,7 @@ int addrconf_set_dstaddr(struct net *net, void __user *arg)
|
||||||
if (dev == NULL)
|
if (dev == NULL)
|
||||||
goto err_exit;
|
goto err_exit;
|
||||||
|
|
||||||
#if defined(CONFIG_IPV6_SIT) || defined(CONFIG_IPV6_SIT_MODULE)
|
#if IS_ENABLED(CONFIG_IPV6_SIT)
|
||||||
if (dev->type == ARPHRD_SIT) {
|
if (dev->type == ARPHRD_SIT) {
|
||||||
const struct net_device_ops *ops = dev->netdev_ops;
|
const struct net_device_ops *ops = dev->netdev_ops;
|
||||||
struct ifreq ifr;
|
struct ifreq ifr;
|
||||||
|
@ -2461,7 +2461,7 @@ static void add_addr(struct inet6_dev *idev, const struct in6_addr *addr,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(CONFIG_IPV6_SIT) || defined(CONFIG_IPV6_SIT_MODULE)
|
#if IS_ENABLED(CONFIG_IPV6_SIT)
|
||||||
static void sit_add_v4_addrs(struct inet6_dev *idev)
|
static void sit_add_v4_addrs(struct inet6_dev *idev)
|
||||||
{
|
{
|
||||||
struct in6_addr addr;
|
struct in6_addr addr;
|
||||||
|
@ -2580,7 +2580,7 @@ static void addrconf_dev_config(struct net_device *dev)
|
||||||
addrconf_add_linklocal(idev, &addr);
|
addrconf_add_linklocal(idev, &addr);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(CONFIG_IPV6_SIT) || defined(CONFIG_IPV6_SIT_MODULE)
|
#if IS_ENABLED(CONFIG_IPV6_SIT)
|
||||||
static void addrconf_sit_config(struct net_device *dev)
|
static void addrconf_sit_config(struct net_device *dev)
|
||||||
{
|
{
|
||||||
struct inet6_dev *idev;
|
struct inet6_dev *idev;
|
||||||
|
@ -2617,7 +2617,7 @@ static void addrconf_sit_config(struct net_device *dev)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(CONFIG_NET_IPGRE) || defined(CONFIG_NET_IPGRE_MODULE)
|
#if IS_ENABLED(CONFIG_NET_IPGRE)
|
||||||
static void addrconf_gre_config(struct net_device *dev)
|
static void addrconf_gre_config(struct net_device *dev)
|
||||||
{
|
{
|
||||||
struct inet6_dev *idev;
|
struct inet6_dev *idev;
|
||||||
|
@ -2747,12 +2747,12 @@ static int addrconf_notify(struct notifier_block *this, unsigned long event,
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (dev->type) {
|
switch (dev->type) {
|
||||||
#if defined(CONFIG_IPV6_SIT) || defined(CONFIG_IPV6_SIT_MODULE)
|
#if IS_ENABLED(CONFIG_IPV6_SIT)
|
||||||
case ARPHRD_SIT:
|
case ARPHRD_SIT:
|
||||||
addrconf_sit_config(dev);
|
addrconf_sit_config(dev);
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
#if defined(CONFIG_NET_IPGRE) || defined(CONFIG_NET_IPGRE_MODULE)
|
#if IS_ENABLED(CONFIG_NET_IPGRE)
|
||||||
case ARPHRD_IPGRE:
|
case ARPHRD_IPGRE:
|
||||||
addrconf_gre_config(dev);
|
addrconf_gre_config(dev);
|
||||||
break;
|
break;
|
||||||
|
@ -3340,7 +3340,7 @@ void if6_proc_exit(void)
|
||||||
}
|
}
|
||||||
#endif /* CONFIG_PROC_FS */
|
#endif /* CONFIG_PROC_FS */
|
||||||
|
|
||||||
#if defined(CONFIG_IPV6_MIP6) || defined(CONFIG_IPV6_MIP6_MODULE)
|
#if IS_ENABLED(CONFIG_IPV6_MIP6)
|
||||||
/* Check if address is a home address configured on any interface. */
|
/* Check if address is a home address configured on any interface. */
|
||||||
int ipv6_chk_home_addr(struct net *net, const struct in6_addr *addr)
|
int ipv6_chk_home_addr(struct net *net, const struct in6_addr *addr)
|
||||||
{
|
{
|
||||||
|
|
|
@ -44,7 +44,7 @@
|
||||||
#define IPV6HDR_BASELEN 8
|
#define IPV6HDR_BASELEN 8
|
||||||
|
|
||||||
struct tmp_ext {
|
struct tmp_ext {
|
||||||
#if defined(CONFIG_IPV6_MIP6) || defined(CONFIG_IPV6_MIP6_MODULE)
|
#if IS_ENABLED(CONFIG_IPV6_MIP6)
|
||||||
struct in6_addr saddr;
|
struct in6_addr saddr;
|
||||||
#endif
|
#endif
|
||||||
struct in6_addr daddr;
|
struct in6_addr daddr;
|
||||||
|
@ -152,7 +152,7 @@ bad:
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(CONFIG_IPV6_MIP6) || defined(CONFIG_IPV6_MIP6_MODULE)
|
#if IS_ENABLED(CONFIG_IPV6_MIP6)
|
||||||
/**
|
/**
|
||||||
* ipv6_rearrange_destopt - rearrange IPv6 destination options header
|
* ipv6_rearrange_destopt - rearrange IPv6 destination options header
|
||||||
* @iph: IPv6 header
|
* @iph: IPv6 header
|
||||||
|
@ -320,7 +320,7 @@ static void ah6_output_done(struct crypto_async_request *base, int err)
|
||||||
memcpy(top_iph, iph_base, IPV6HDR_BASELEN);
|
memcpy(top_iph, iph_base, IPV6HDR_BASELEN);
|
||||||
|
|
||||||
if (extlen) {
|
if (extlen) {
|
||||||
#if defined(CONFIG_IPV6_MIP6) || defined(CONFIG_IPV6_MIP6_MODULE)
|
#if IS_ENABLED(CONFIG_IPV6_MIP6)
|
||||||
memcpy(&top_iph->saddr, iph_ext, extlen);
|
memcpy(&top_iph->saddr, iph_ext, extlen);
|
||||||
#else
|
#else
|
||||||
memcpy(&top_iph->daddr, iph_ext, extlen);
|
memcpy(&top_iph->daddr, iph_ext, extlen);
|
||||||
|
@ -385,7 +385,7 @@ static int ah6_output(struct xfrm_state *x, struct sk_buff *skb)
|
||||||
memcpy(iph_base, top_iph, IPV6HDR_BASELEN);
|
memcpy(iph_base, top_iph, IPV6HDR_BASELEN);
|
||||||
|
|
||||||
if (extlen) {
|
if (extlen) {
|
||||||
#if defined(CONFIG_IPV6_MIP6) || defined(CONFIG_IPV6_MIP6_MODULE)
|
#if IS_ENABLED(CONFIG_IPV6_MIP6)
|
||||||
memcpy(iph_ext, &top_iph->saddr, extlen);
|
memcpy(iph_ext, &top_iph->saddr, extlen);
|
||||||
#else
|
#else
|
||||||
memcpy(iph_ext, &top_iph->daddr, extlen);
|
memcpy(iph_ext, &top_iph->daddr, extlen);
|
||||||
|
@ -434,7 +434,7 @@ static int ah6_output(struct xfrm_state *x, struct sk_buff *skb)
|
||||||
memcpy(top_iph, iph_base, IPV6HDR_BASELEN);
|
memcpy(top_iph, iph_base, IPV6HDR_BASELEN);
|
||||||
|
|
||||||
if (extlen) {
|
if (extlen) {
|
||||||
#if defined(CONFIG_IPV6_MIP6) || defined(CONFIG_IPV6_MIP6_MODULE)
|
#if IS_ENABLED(CONFIG_IPV6_MIP6)
|
||||||
memcpy(&top_iph->saddr, iph_ext, extlen);
|
memcpy(&top_iph->saddr, iph_ext, extlen);
|
||||||
#else
|
#else
|
||||||
memcpy(&top_iph->daddr, iph_ext, extlen);
|
memcpy(&top_iph->daddr, iph_ext, extlen);
|
||||||
|
|
|
@ -769,7 +769,7 @@ int datagram_send_ctl(struct net *net, struct sock *sk,
|
||||||
rthdr = (struct ipv6_rt_hdr *)CMSG_DATA(cmsg);
|
rthdr = (struct ipv6_rt_hdr *)CMSG_DATA(cmsg);
|
||||||
|
|
||||||
switch (rthdr->type) {
|
switch (rthdr->type) {
|
||||||
#if defined(CONFIG_IPV6_MIP6) || defined(CONFIG_IPV6_MIP6_MODULE)
|
#if IS_ENABLED(CONFIG_IPV6_MIP6)
|
||||||
case IPV6_SRCRT_TYPE_2:
|
case IPV6_SRCRT_TYPE_2:
|
||||||
if (rthdr->hdrlen != 2 ||
|
if (rthdr->hdrlen != 2 ||
|
||||||
rthdr->segments_left != 1) {
|
rthdr->segments_left != 1) {
|
||||||
|
|
|
@ -43,7 +43,7 @@
|
||||||
#include <net/ndisc.h>
|
#include <net/ndisc.h>
|
||||||
#include <net/ip6_route.h>
|
#include <net/ip6_route.h>
|
||||||
#include <net/addrconf.h>
|
#include <net/addrconf.h>
|
||||||
#if defined(CONFIG_IPV6_MIP6) || defined(CONFIG_IPV6_MIP6_MODULE)
|
#if IS_ENABLED(CONFIG_IPV6_MIP6)
|
||||||
#include <net/xfrm.h>
|
#include <net/xfrm.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -224,7 +224,7 @@ bad:
|
||||||
Destination options header.
|
Destination options header.
|
||||||
*****************************/
|
*****************************/
|
||||||
|
|
||||||
#if defined(CONFIG_IPV6_MIP6) || defined(CONFIG_IPV6_MIP6_MODULE)
|
#if IS_ENABLED(CONFIG_IPV6_MIP6)
|
||||||
static bool ipv6_dest_hao(struct sk_buff *skb, int optoff)
|
static bool ipv6_dest_hao(struct sk_buff *skb, int optoff)
|
||||||
{
|
{
|
||||||
struct ipv6_destopt_hao *hao;
|
struct ipv6_destopt_hao *hao;
|
||||||
|
@ -288,7 +288,7 @@ static bool ipv6_dest_hao(struct sk_buff *skb, int optoff)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static const struct tlvtype_proc tlvprocdestopt_lst[] = {
|
static const struct tlvtype_proc tlvprocdestopt_lst[] = {
|
||||||
#if defined(CONFIG_IPV6_MIP6) || defined(CONFIG_IPV6_MIP6_MODULE)
|
#if IS_ENABLED(CONFIG_IPV6_MIP6)
|
||||||
{
|
{
|
||||||
.type = IPV6_TLV_HAO,
|
.type = IPV6_TLV_HAO,
|
||||||
.func = ipv6_dest_hao,
|
.func = ipv6_dest_hao,
|
||||||
|
@ -300,7 +300,7 @@ static const struct tlvtype_proc tlvprocdestopt_lst[] = {
|
||||||
static int ipv6_destopt_rcv(struct sk_buff *skb)
|
static int ipv6_destopt_rcv(struct sk_buff *skb)
|
||||||
{
|
{
|
||||||
struct inet6_skb_parm *opt = IP6CB(skb);
|
struct inet6_skb_parm *opt = IP6CB(skb);
|
||||||
#if defined(CONFIG_IPV6_MIP6) || defined(CONFIG_IPV6_MIP6_MODULE)
|
#if IS_ENABLED(CONFIG_IPV6_MIP6)
|
||||||
__u16 dstbuf;
|
__u16 dstbuf;
|
||||||
#endif
|
#endif
|
||||||
struct dst_entry *dst = skb_dst(skb);
|
struct dst_entry *dst = skb_dst(skb);
|
||||||
|
@ -315,14 +315,14 @@ static int ipv6_destopt_rcv(struct sk_buff *skb)
|
||||||
}
|
}
|
||||||
|
|
||||||
opt->lastopt = opt->dst1 = skb_network_header_len(skb);
|
opt->lastopt = opt->dst1 = skb_network_header_len(skb);
|
||||||
#if defined(CONFIG_IPV6_MIP6) || defined(CONFIG_IPV6_MIP6_MODULE)
|
#if IS_ENABLED(CONFIG_IPV6_MIP6)
|
||||||
dstbuf = opt->dst1;
|
dstbuf = opt->dst1;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (ip6_parse_tlv(tlvprocdestopt_lst, skb)) {
|
if (ip6_parse_tlv(tlvprocdestopt_lst, skb)) {
|
||||||
skb->transport_header += (skb_transport_header(skb)[1] + 1) << 3;
|
skb->transport_header += (skb_transport_header(skb)[1] + 1) << 3;
|
||||||
opt = IP6CB(skb);
|
opt = IP6CB(skb);
|
||||||
#if defined(CONFIG_IPV6_MIP6) || defined(CONFIG_IPV6_MIP6_MODULE)
|
#if IS_ENABLED(CONFIG_IPV6_MIP6)
|
||||||
opt->nhoff = dstbuf;
|
opt->nhoff = dstbuf;
|
||||||
#else
|
#else
|
||||||
opt->nhoff = opt->dst1;
|
opt->nhoff = opt->dst1;
|
||||||
|
@ -378,7 +378,7 @@ static int ipv6_rthdr_rcv(struct sk_buff *skb)
|
||||||
looped_back:
|
looped_back:
|
||||||
if (hdr->segments_left == 0) {
|
if (hdr->segments_left == 0) {
|
||||||
switch (hdr->type) {
|
switch (hdr->type) {
|
||||||
#if defined(CONFIG_IPV6_MIP6) || defined(CONFIG_IPV6_MIP6_MODULE)
|
#if IS_ENABLED(CONFIG_IPV6_MIP6)
|
||||||
case IPV6_SRCRT_TYPE_2:
|
case IPV6_SRCRT_TYPE_2:
|
||||||
/* Silently discard type 2 header unless it was
|
/* Silently discard type 2 header unless it was
|
||||||
* processed by own
|
* processed by own
|
||||||
|
@ -404,7 +404,7 @@ looped_back:
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (hdr->type) {
|
switch (hdr->type) {
|
||||||
#if defined(CONFIG_IPV6_MIP6) || defined(CONFIG_IPV6_MIP6_MODULE)
|
#if IS_ENABLED(CONFIG_IPV6_MIP6)
|
||||||
case IPV6_SRCRT_TYPE_2:
|
case IPV6_SRCRT_TYPE_2:
|
||||||
if (accept_source_route < 0)
|
if (accept_source_route < 0)
|
||||||
goto unknown_rh;
|
goto unknown_rh;
|
||||||
|
@ -461,7 +461,7 @@ looped_back:
|
||||||
addr += i - 1;
|
addr += i - 1;
|
||||||
|
|
||||||
switch (hdr->type) {
|
switch (hdr->type) {
|
||||||
#if defined(CONFIG_IPV6_MIP6) || defined(CONFIG_IPV6_MIP6_MODULE)
|
#if IS_ENABLED(CONFIG_IPV6_MIP6)
|
||||||
case IPV6_SRCRT_TYPE_2:
|
case IPV6_SRCRT_TYPE_2:
|
||||||
if (xfrm6_input_addr(skb, (xfrm_address_t *)addr,
|
if (xfrm6_input_addr(skb, (xfrm_address_t *)addr,
|
||||||
(xfrm_address_t *)&ipv6_hdr(skb)->saddr,
|
(xfrm_address_t *)&ipv6_hdr(skb)->saddr,
|
||||||
|
|
|
@ -280,7 +280,7 @@ static int icmpv6_getfrag(void *from, char *to, int offset, int len, int odd, st
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(CONFIG_IPV6_MIP6) || defined(CONFIG_IPV6_MIP6_MODULE)
|
#if IS_ENABLED(CONFIG_IPV6_MIP6)
|
||||||
static void mip6_addr_swap(struct sk_buff *skb)
|
static void mip6_addr_swap(struct sk_buff *skb)
|
||||||
{
|
{
|
||||||
struct ipv6hdr *iph = ipv6_hdr(skb);
|
struct ipv6hdr *iph = ipv6_hdr(skb);
|
||||||
|
|
|
@ -538,8 +538,7 @@ static void ip6_copy_metadata(struct sk_buff *to, struct sk_buff *from)
|
||||||
to->tc_index = from->tc_index;
|
to->tc_index = from->tc_index;
|
||||||
#endif
|
#endif
|
||||||
nf_copy(to, from);
|
nf_copy(to, from);
|
||||||
#if defined(CONFIG_NETFILTER_XT_TARGET_TRACE) || \
|
#if IS_ENABLED(CONFIG_NETFILTER_XT_TARGET_TRACE)
|
||||||
defined(CONFIG_NETFILTER_XT_TARGET_TRACE_MODULE)
|
|
||||||
to->nf_trace = from->nf_trace;
|
to->nf_trace = from->nf_trace;
|
||||||
#endif
|
#endif
|
||||||
skb_copy_secmark(to, from);
|
skb_copy_secmark(to, from);
|
||||||
|
@ -564,7 +563,7 @@ int ip6_find_1stfragopt(struct sk_buff *skb, u8 **nexthdr)
|
||||||
found_rhdr = 1;
|
found_rhdr = 1;
|
||||||
break;
|
break;
|
||||||
case NEXTHDR_DEST:
|
case NEXTHDR_DEST:
|
||||||
#if defined(CONFIG_IPV6_MIP6) || defined(CONFIG_IPV6_MIP6_MODULE)
|
#if IS_ENABLED(CONFIG_IPV6_MIP6)
|
||||||
if (ipv6_find_tlv(skb, offset, IPV6_TLV_HAO) >= 0)
|
if (ipv6_find_tlv(skb, offset, IPV6_TLV_HAO) >= 0)
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -397,7 +397,7 @@ static int do_ipv6_setsockopt(struct sock *sk, int level, int optname,
|
||||||
if (optname == IPV6_RTHDR && opt && opt->srcrt) {
|
if (optname == IPV6_RTHDR && opt && opt->srcrt) {
|
||||||
struct ipv6_rt_hdr *rthdr = opt->srcrt;
|
struct ipv6_rt_hdr *rthdr = opt->srcrt;
|
||||||
switch (rthdr->type) {
|
switch (rthdr->type) {
|
||||||
#if defined(CONFIG_IPV6_MIP6) || defined(CONFIG_IPV6_MIP6_MODULE)
|
#if IS_ENABLED(CONFIG_IPV6_MIP6)
|
||||||
case IPV6_SRCRT_TYPE_2:
|
case IPV6_SRCRT_TYPE_2:
|
||||||
if (rthdr->hdrlen != 2 ||
|
if (rthdr->hdrlen != 2 ||
|
||||||
rthdr->segments_left != 1)
|
rthdr->segments_left != 1)
|
||||||
|
|
|
@ -207,8 +207,7 @@ ip6t_get_target_c(const struct ip6t_entry *e)
|
||||||
return ip6t_get_target((struct ip6t_entry *)e);
|
return ip6t_get_target((struct ip6t_entry *)e);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(CONFIG_NETFILTER_XT_TARGET_TRACE) || \
|
#if IS_ENABLED(CONFIG_NETFILTER_XT_TARGET_TRACE)
|
||||||
defined(CONFIG_NETFILTER_XT_TARGET_TRACE_MODULE)
|
|
||||||
/* This cries for unification! */
|
/* This cries for unification! */
|
||||||
static const char *const hooknames[] = {
|
static const char *const hooknames[] = {
|
||||||
[NF_INET_PRE_ROUTING] = "PREROUTING",
|
[NF_INET_PRE_ROUTING] = "PREROUTING",
|
||||||
|
@ -381,8 +380,7 @@ ip6t_do_table(struct sk_buff *skb,
|
||||||
t = ip6t_get_target_c(e);
|
t = ip6t_get_target_c(e);
|
||||||
IP_NF_ASSERT(t->u.kernel.target);
|
IP_NF_ASSERT(t->u.kernel.target);
|
||||||
|
|
||||||
#if defined(CONFIG_NETFILTER_XT_TARGET_TRACE) || \
|
#if IS_ENABLED(CONFIG_NETFILTER_XT_TARGET_TRACE)
|
||||||
defined(CONFIG_NETFILTER_XT_TARGET_TRACE_MODULE)
|
|
||||||
/* The packet is traced: log it */
|
/* The packet is traced: log it */
|
||||||
if (unlikely(skb->nf_trace))
|
if (unlikely(skb->nf_trace))
|
||||||
trace_packet(skb, hook, in, out,
|
trace_packet(skb, hook, in, out,
|
||||||
|
|
|
@ -295,7 +295,7 @@ static struct nf_hook_ops ipv6_conntrack_ops[] __read_mostly = {
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
#if defined(CONFIG_NF_CT_NETLINK) || defined(CONFIG_NF_CT_NETLINK_MODULE)
|
#if IS_ENABLED(CONFIG_NF_CT_NETLINK)
|
||||||
|
|
||||||
#include <linux/netfilter/nfnetlink.h>
|
#include <linux/netfilter/nfnetlink.h>
|
||||||
#include <linux/netfilter/nfnetlink_conntrack.h>
|
#include <linux/netfilter/nfnetlink_conntrack.h>
|
||||||
|
@ -346,7 +346,7 @@ struct nf_conntrack_l3proto nf_conntrack_l3proto_ipv6 __read_mostly = {
|
||||||
.invert_tuple = ipv6_invert_tuple,
|
.invert_tuple = ipv6_invert_tuple,
|
||||||
.print_tuple = ipv6_print_tuple,
|
.print_tuple = ipv6_print_tuple,
|
||||||
.get_l4proto = ipv6_get_l4proto,
|
.get_l4proto = ipv6_get_l4proto,
|
||||||
#if defined(CONFIG_NF_CT_NETLINK) || defined(CONFIG_NF_CT_NETLINK_MODULE)
|
#if IS_ENABLED(CONFIG_NF_CT_NETLINK)
|
||||||
.tuple_to_nlattr = ipv6_tuple_to_nlattr,
|
.tuple_to_nlattr = ipv6_tuple_to_nlattr,
|
||||||
.nlattr_tuple_size = ipv6_nlattr_tuple_size,
|
.nlattr_tuple_size = ipv6_nlattr_tuple_size,
|
||||||
.nlattr_to_tuple = ipv6_nlattr_to_tuple,
|
.nlattr_to_tuple = ipv6_nlattr_to_tuple,
|
||||||
|
|
|
@ -232,7 +232,7 @@ icmpv6_error(struct net *net, struct nf_conn *tmpl,
|
||||||
return icmpv6_error_message(net, tmpl, skb, dataoff, ctinfo, hooknum);
|
return icmpv6_error_message(net, tmpl, skb, dataoff, ctinfo, hooknum);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(CONFIG_NF_CT_NETLINK) || defined(CONFIG_NF_CT_NETLINK_MODULE)
|
#if IS_ENABLED(CONFIG_NF_CT_NETLINK)
|
||||||
|
|
||||||
#include <linux/netfilter/nfnetlink.h>
|
#include <linux/netfilter/nfnetlink.h>
|
||||||
#include <linux/netfilter/nfnetlink_conntrack.h>
|
#include <linux/netfilter/nfnetlink_conntrack.h>
|
||||||
|
@ -375,7 +375,7 @@ struct nf_conntrack_l4proto nf_conntrack_l4proto_icmpv6 __read_mostly =
|
||||||
.get_timeouts = icmpv6_get_timeouts,
|
.get_timeouts = icmpv6_get_timeouts,
|
||||||
.new = icmpv6_new,
|
.new = icmpv6_new,
|
||||||
.error = icmpv6_error,
|
.error = icmpv6_error,
|
||||||
#if defined(CONFIG_NF_CT_NETLINK) || defined(CONFIG_NF_CT_NETLINK_MODULE)
|
#if IS_ENABLED(CONFIG_NF_CT_NETLINK)
|
||||||
.tuple_to_nlattr = icmpv6_tuple_to_nlattr,
|
.tuple_to_nlattr = icmpv6_tuple_to_nlattr,
|
||||||
.nlattr_tuple_size = icmpv6_nlattr_tuple_size,
|
.nlattr_tuple_size = icmpv6_nlattr_tuple_size,
|
||||||
.nlattr_to_tuple = icmpv6_nlattr_to_tuple,
|
.nlattr_to_tuple = icmpv6_nlattr_to_tuple,
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
|
|
||||||
#include <linux/netfilter_ipv6.h>
|
#include <linux/netfilter_ipv6.h>
|
||||||
#include <linux/netfilter_bridge.h>
|
#include <linux/netfilter_bridge.h>
|
||||||
#if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE)
|
#if IS_ENABLED(CONFIG_NF_CONNTRACK)
|
||||||
#include <net/netfilter/nf_conntrack.h>
|
#include <net/netfilter/nf_conntrack.h>
|
||||||
#include <net/netfilter/nf_conntrack_helper.h>
|
#include <net/netfilter/nf_conntrack_helper.h>
|
||||||
#include <net/netfilter/nf_conntrack_l4proto.h>
|
#include <net/netfilter/nf_conntrack_l4proto.h>
|
||||||
|
@ -35,7 +35,7 @@ static enum ip6_defrag_users nf_ct6_defrag_user(unsigned int hooknum,
|
||||||
{
|
{
|
||||||
u16 zone = NF_CT_DEFAULT_ZONE;
|
u16 zone = NF_CT_DEFAULT_ZONE;
|
||||||
|
|
||||||
#if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE)
|
#if IS_ENABLED(CONFIG_NF_CONNTRACK)
|
||||||
if (skb->nfct)
|
if (skb->nfct)
|
||||||
zone = nf_ct_zone((struct nf_conn *)skb->nfct);
|
zone = nf_ct_zone((struct nf_conn *)skb->nfct);
|
||||||
#endif
|
#endif
|
||||||
|
@ -60,7 +60,7 @@ static unsigned int ipv6_defrag(unsigned int hooknum,
|
||||||
{
|
{
|
||||||
struct sk_buff *reasm;
|
struct sk_buff *reasm;
|
||||||
|
|
||||||
#if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE)
|
#if IS_ENABLED(CONFIG_NF_CONNTRACK)
|
||||||
/* Previously seen (loopback)? */
|
/* Previously seen (loopback)? */
|
||||||
if (skb->nfct && !nf_ct_is_template((struct nf_conn *)skb->nfct))
|
if (skb->nfct && !nf_ct_is_template((struct nf_conn *)skb->nfct))
|
||||||
return NF_ACCEPT;
|
return NF_ACCEPT;
|
||||||
|
|
|
@ -84,7 +84,7 @@ const struct nf_nat_l4proto nf_nat_l4proto_icmpv6 = {
|
||||||
.manip_pkt = icmpv6_manip_pkt,
|
.manip_pkt = icmpv6_manip_pkt,
|
||||||
.in_range = icmpv6_in_range,
|
.in_range = icmpv6_in_range,
|
||||||
.unique_tuple = icmpv6_unique_tuple,
|
.unique_tuple = icmpv6_unique_tuple,
|
||||||
#if defined(CONFIG_NF_CT_NETLINK) || defined(CONFIG_NF_CT_NETLINK_MODULE)
|
#if IS_ENABLED(CONFIG_NF_CT_NETLINK)
|
||||||
.nlattr_to_range = nf_nat_l4proto_nlattr_to_range,
|
.nlattr_to_range = nf_nat_l4proto_nlattr_to_range,
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
|
|
@ -50,7 +50,7 @@
|
||||||
#include <net/udp.h>
|
#include <net/udp.h>
|
||||||
#include <net/inet_common.h>
|
#include <net/inet_common.h>
|
||||||
#include <net/tcp_states.h>
|
#include <net/tcp_states.h>
|
||||||
#if defined(CONFIG_IPV6_MIP6) || defined(CONFIG_IPV6_MIP6_MODULE)
|
#if IS_ENABLED(CONFIG_IPV6_MIP6)
|
||||||
#include <net/mip6.h>
|
#include <net/mip6.h>
|
||||||
#endif
|
#endif
|
||||||
#include <linux/mroute6.h>
|
#include <linux/mroute6.h>
|
||||||
|
@ -123,7 +123,7 @@ static int icmpv6_filter(const struct sock *sk, const struct sk_buff *skb)
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(CONFIG_IPV6_MIP6) || defined(CONFIG_IPV6_MIP6_MODULE)
|
#if IS_ENABLED(CONFIG_IPV6_MIP6)
|
||||||
typedef int mh_filter_t(struct sock *sock, struct sk_buff *skb);
|
typedef int mh_filter_t(struct sock *sock, struct sk_buff *skb);
|
||||||
|
|
||||||
static mh_filter_t __rcu *mh_filter __read_mostly;
|
static mh_filter_t __rcu *mh_filter __read_mostly;
|
||||||
|
@ -184,7 +184,7 @@ static bool ipv6_raw_deliver(struct sk_buff *skb, int nexthdr)
|
||||||
filtered = icmpv6_filter(sk, skb);
|
filtered = icmpv6_filter(sk, skb);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
#if defined(CONFIG_IPV6_MIP6) || defined(CONFIG_IPV6_MIP6_MODULE)
|
#if IS_ENABLED(CONFIG_IPV6_MIP6)
|
||||||
case IPPROTO_MH:
|
case IPPROTO_MH:
|
||||||
{
|
{
|
||||||
/* XXX: To validate MH only once for each packet,
|
/* XXX: To validate MH only once for each packet,
|
||||||
|
|
|
@ -20,7 +20,7 @@
|
||||||
#include <net/ip.h>
|
#include <net/ip.h>
|
||||||
#include <net/ipv6.h>
|
#include <net/ipv6.h>
|
||||||
#include <net/ip6_route.h>
|
#include <net/ip6_route.h>
|
||||||
#if defined(CONFIG_IPV6_MIP6) || defined(CONFIG_IPV6_MIP6_MODULE)
|
#if IS_ENABLED(CONFIG_IPV6_MIP6)
|
||||||
#include <net/mip6.h>
|
#include <net/mip6.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -182,7 +182,7 @@ _decode_session6(struct sk_buff *skb, struct flowi *fl, int reverse)
|
||||||
fl6->flowi6_proto = nexthdr;
|
fl6->flowi6_proto = nexthdr;
|
||||||
return;
|
return;
|
||||||
|
|
||||||
#if defined(CONFIG_IPV6_MIP6) || defined(CONFIG_IPV6_MIP6_MODULE)
|
#if IS_ENABLED(CONFIG_IPV6_MIP6)
|
||||||
case IPPROTO_MH:
|
case IPPROTO_MH:
|
||||||
if (!onlyproto && pskb_may_pull(skb, nh + offset + 3 - skb->data)) {
|
if (!onlyproto && pskb_may_pull(skb, nh + offset + 3 - skb->data)) {
|
||||||
struct ip6_mh *mh;
|
struct ip6_mh *mh;
|
||||||
|
|
|
@ -101,7 +101,7 @@ static int __xfrm6_state_sort_cmp(void *p)
|
||||||
return 1;
|
return 1;
|
||||||
else
|
else
|
||||||
return 3;
|
return 3;
|
||||||
#if defined(CONFIG_IPV6_MIP6) || defined(CONFIG_IPV6_MIP6_MODULE)
|
#if IS_ENABLED(CONFIG_IPV6_MIP6)
|
||||||
case XFRM_MODE_ROUTEOPTIMIZATION:
|
case XFRM_MODE_ROUTEOPTIMIZATION:
|
||||||
case XFRM_MODE_IN_TRIGGER:
|
case XFRM_MODE_IN_TRIGGER:
|
||||||
return 2;
|
return 2;
|
||||||
|
@ -134,7 +134,7 @@ static int __xfrm6_tmpl_sort_cmp(void *p)
|
||||||
switch (v->mode) {
|
switch (v->mode) {
|
||||||
case XFRM_MODE_TRANSPORT:
|
case XFRM_MODE_TRANSPORT:
|
||||||
return 1;
|
return 1;
|
||||||
#if defined(CONFIG_IPV6_MIP6) || defined(CONFIG_IPV6_MIP6_MODULE)
|
#if IS_ENABLED(CONFIG_IPV6_MIP6)
|
||||||
case XFRM_MODE_ROUTEOPTIMIZATION:
|
case XFRM_MODE_ROUTEOPTIMIZATION:
|
||||||
case XFRM_MODE_IN_TRIGGER:
|
case XFRM_MODE_IN_TRIGGER:
|
||||||
return 2;
|
return 2;
|
||||||
|
|
Loading…
Reference in New Issue