tree:
https://git.kernel.org/pub/scm/linux/kernel/git/sashal/linux-stable.git
pending-4.19
head: da0ab6f9b4814a4a16e1999273d7dbd1a348314b
commit: 0d2758421c8819aae1c231d905be29419b0da83c [29/61] netfilter: nft_fib: Convert
nft_fib4_eval to new dev helper
config: i386-allyesconfig (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce (this is a W=1 build):
#
https://git.kernel.org/pub/scm/linux/kernel/git/sashal/linux-stable.git/c...
git remote add sashal-linux-stable
https://git.kernel.org/pub/scm/linux/kernel/git/sashal/linux-stable.git
git fetch --no-tags sashal-linux-stable pending-4.19
git checkout 0d2758421c8819aae1c231d905be29419b0da83c
# save the attached .config to linux build tree
make W=1 ARCH=i386
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
net/ipv4/netfilter/nft_fib_ipv4.c: In function 'nft_fib4_eval':
> net/ipv4/netfilter/nft_fib_ipv4.c:147:8: error: implicit
declaration of function 'fib_info_nh_uses_dev'
[-Werror=implicit-function-declaration]
147 | if
(!fib_info_nh_uses_dev(res.fi, oif))
| ^~~~~~~~~~~~~~~~~~~~
cc1: some warnings being treated as errors
vim +/fib_info_nh_uses_dev +147 net/ipv4/netfilter/nft_fib_ipv4.c
65
66 void nft_fib4_eval(const struct nft_expr *expr, struct nft_regs *regs,
67 const struct nft_pktinfo *pkt)
68 {
69 const struct nft_fib *priv = nft_expr_priv(expr);
70 int noff = skb_network_offset(pkt->skb);
71 u32 *dest = ®s->data[priv->dreg];
72 struct iphdr *iph, _iph;
73 struct fib_result res;
74 struct flowi4 fl4 = {
75 .flowi4_scope = RT_SCOPE_UNIVERSE,
76 .flowi4_iif = LOOPBACK_IFINDEX,
77 };
78 const struct net_device *oif;
79 const struct net_device *found;
80
81 /*
82 * Do not set flowi4_oif, it restricts results (for example, asking
83 * for oif 3 will get RTN_UNICAST result even if the daddr exits
84 * on another interface.
85 *
86 * Search results for the desired outinterface instead.
87 */
88 if (priv->flags & NFTA_FIB_F_OIF)
89 oif = nft_out(pkt);
90 else if (priv->flags & NFTA_FIB_F_IIF)
91 oif = nft_in(pkt);
92 else
93 oif = NULL;
94
95 if (nft_hook(pkt) == NF_INET_PRE_ROUTING &&
96 nft_fib_is_loopback(pkt->skb, nft_in(pkt))) {
97 nft_fib_store_result(dest, priv, pkt,
98 nft_in(pkt)->ifindex);
99 return;
100 }
101
102 iph = skb_header_pointer(pkt->skb, noff, sizeof(_iph), &_iph);
103 if (!iph) {
104 regs->verdict.code = NFT_BREAK;
105 return;
106 }
107
108 if (ipv4_is_zeronet(iph->saddr)) {
109 if (ipv4_is_lbcast(iph->daddr) ||
110 ipv4_is_local_multicast(iph->daddr)) {
111 nft_fib_store_result(dest, priv, pkt,
112 get_ifindex(pkt->skb->dev));
113 return;
114 }
115 }
116
117 if (priv->flags & NFTA_FIB_F_MARK)
118 fl4.flowi4_mark = pkt->skb->mark;
119
120 fl4.flowi4_tos = iph->tos & DSCP_BITS;
121
122 if (priv->flags & NFTA_FIB_F_DADDR) {
123 fl4.daddr = iph->daddr;
124 fl4.saddr = get_saddr(iph->saddr);
125 } else {
126 fl4.daddr = iph->saddr;
127 fl4.saddr = get_saddr(iph->daddr);
128 }
129
130 *dest = 0;
131
132 if (fib_lookup(nft_net(pkt), &fl4, &res, FIB_LOOKUP_IGNORE_LINKSTATE))
133 return;
134
135 switch (res.type) {
136 case RTN_UNICAST:
137 break;
138 case RTN_LOCAL: /* Should not see RTN_LOCAL here */
139 return;
140 default:
141 break;
142 }
143
144 if (!oif) {
145 found = FIB_RES_DEV(res);
146 } else {
147 if (!fib_info_nh_uses_dev(res.fi, oif))
148 return;
149
150 found = oif;
151 }
152
153 switch (priv->result) {
154 case NFT_FIB_RESULT_OIF:
155 *dest = found->ifindex;
156 break;
157 case NFT_FIB_RESULT_OIFNAME:
158 strncpy((char *)dest, found->name, IFNAMSIZ);
159 break;
160 default:
161 WARN_ON_ONCE(1);
162 break;
163 }
164 }
165 EXPORT_SYMBOL_GPL(nft_fib4_eval);
166
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org