Re: [PATCH 1/3] rtnetlink: return EMSGSIZE when first dump entry does not fit
From: Stephen Hemminger
Date: Tue Nov 10 2026 - 13:04:36 EST
On Tue, 10 Nov 2026 16:27:41 +0800
Hangbin Liu <hangbin.liu@xxxxxxxxx> wrote:
> Hi Stephen,
> On Sun, Nov 08, 2026 at 05:13:12PM -0800, Stephen Hemminger wrote:
> > If a route entry is too large for the dump skb, the dump is silently
> > truncated and no error is returned.
> >
> > For handlers with RTNL_FLAG_DUMP_SPLIT_NLM_DONE, rtnl_dumpit() drops
> > -EMSGSIZE and returns skb->len. With an empty skb this is 0, so the
> > dump ends with NLMSG_DONE and status 0, and the remaining entries are
> > lost.
> >
> > The first dump skb is allocated from __netlink_dump_start() while
> > max_recvmsg_len is still 0, so it is only NLMSG_GOODSIZE. On a 4K page
> > kernel that is under 4000 bytes, and a 500 way multipath route does not
> > fit:
> >
> > ip link add dummy0 type dummy
> > ip link set dummy0 up
> > ip route add 198.51.100.0/24 table 100 \
> > $(for i in $(seq 500); do echo -n "nexthop dev dummy0 "; done)
> > ip route show table 100
> >
> > The dump prints nothing and exits 0, although "ip route get
> > 198.51.100.1 table 100" still shows the route.
>
> One question. AFAIK, `ip route get` doesn't support "table" parameter. No?
>
> Thanks
> Hangbin
Your right AI is wrong in the commit message.
A way to use get is to add a rule.
# ip rule add to 198.51.100.0/24 lookup 100
# ip route get 198.51.100.1
198.51.100.1 dev dummy0 table 100 src 192.168.50.131 uid 0
cache
But best to just drop the incorrect wording there.