BPF List
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Fernando Fernandez Mancera" <fmancera@suse.de>
Cc: bpf@vger.kernel.org
Subject: Re: [PATCH 09/16 net-next v3] ipv4: fib: split common nexthop logic to fib_core.c
Date: Thu, 01 Oct 2026 14:05:07 +0000	[thread overview]
Message-ID: <20261001140507.C5C4E1F00898@smtp.kernel.org> (raw)
In-Reply-To: <20260930135334.4739-10-fmancera@suse.de>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] net: build failure due to missing IPv4 nexthop stubs
--

commit 37eb694c7118e7af349ed67aa655f6c7aa572300
Author: Fernando Fernandez Mancera <fmancera@suse.de>

ipv4: fib: split common nexthop logic to fib_core.c

To enable compiling INET subsystem without IPv4, shared FIB and nexthop
logic must be accessible to IPv6 when IPv4 routing stack is omitted.

This patch creates fib_core.c and move all the functions for common
nexthop initialization and release from fib_semantics.c to fib_core.c.
Note that fib_core.c is under net/core.

> diff --git a/include/net/ip_fib.h b/include/net/ip_fib.h
> index 0a35355fb0f33..6058e53fa3dec 100644
> --- a/include/net/ip_fib.h
> +++ b/include/net/ip_fib.h
[ ... ]
> @@ -578,10 +584,23 @@ void fib_select_multipath(struct fib_result *res, int hash,
>  void fib_select_path(struct net *net, struct fib_result *res,
>  		     struct flowi4 *fl4, const struct sk_buff *skb);
>  
> +#if IS_ENABLED(CONFIG_IPV4)
>  int fib_nh_init(struct net *net, struct fib_nh *fib_nh,
>  		struct fib_config *cfg, int nh_weight,
>  		struct netlink_ext_ack *extack);
>  void fib_nh_release(struct net *net, struct fib_nh *fib_nh);
> +#else
> +static inline int fib_nh_init(struct net *net, struct fib_nh *fib_nh,
> +			      struct fib_config *cfg, int nh_weight,
> +			      struct netlink_ext_ack *extack)
> +{
> +	return -EAFNOSUPPORT;
> +}
> +
> +static inline void fib_nh_release(struct net *net, struct fib_nh *fib_nh)
> +{
> +}
> +#endif

[Severity: Low]
When CONFIG_IPV4 is disabled, fib_check_nh() and fib_info_update_nhc_saddr()
are missing fallbacks.

Because net/ipv4/nexthop.c is unconditionally built for CONFIG_INET, its
nh_create_ipv4() function still references these functions, causing a build
failure at link time:

net/ipv4/nexthop.c:nh_create_ipv4() {
    ...
	/* sets nh_dev if successful */
	err = fib_check_nh(net, fib_nh, tb_id, 0, extack);
	if (!err) {
		nh->nh_flags = fib_nh->fib_nh_flags;
		fib_info_update_nhc_saddr(net, &fib_nh->nh_common,
					  !fib_nh->fib_nh_scope ? 0 : fib_nh->fib_nh_scope - 1);
    ...
}

Should we add fallback stubs for these functions here in ip_fib.h, similar to
fib_nh_init() and fib_nh_release(), when CONFIG_IPV4 is disabled?

>  int fib_nh_common_init(struct net *net, struct fib_nh_common *nhc,
>  		       struct nlattr *fc_encap, u16 fc_encap_type,
>  		       void *cfg, gfp_t gfp_flags,

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260930135334.4739-1-fmancera@suse.de?part=9

      reply	other threads:[~2026-10-01 14:05 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20260930135334.4739-1-fmancera@suse.de>
2026-09-30 13:52 ` [PATCH 02/16 net-next v3] net: core: add IPv4 fallback stubs and guards for CONFIG_IPV4=n Fernando Fernandez Mancera
2026-09-30 13:52 ` [PATCH 04/16 net-next v3] tcp: move protocol agnostic TCP functions out of tcp_ipv4.c Fernando Fernandez Mancera
2026-09-30 13:52 ` [PATCH 06/16 net-next v3] ipv4: udp: split IPv4 specific logic into udp_ipv4.c Fernando Fernandez Mancera
2026-09-30 13:52 ` [PATCH 08/16 net-next v3] ipv4: ping: split IPv4 specific logic into ping_ipv4.c Fernando Fernandez Mancera
2026-09-30 13:52 ` [PATCH 09/16 net-next v3] ipv4: fib: split common nexthop logic to fib_core.c Fernando Fernandez Mancera
2026-10-01 14:05   ` sashiko-bot [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261001140507.C5C4E1F00898@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=fmancera@suse.de \
    --cc=sashiko-reviews@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox