[prev in list] [next in list] [prev in thread] [next in thread]
List: busybox
Subject: Re: [PATCH] libiproute: fix filtering ip6 route by table id
From: Yousong Zhou <yszhou4tech () gmail ! com>
Date: 2023-03-05 1:38:17
Message-ID: CAECwjAh0aD+rDugMNAmv0NmbNWiK48kXu25+ZS37dzeNfLK8og () mail ! gmail ! com
[Download RAW message or body]
> > The very same code exists in current iproute2 git tree.
> > Is it also buggy in the same way?
>
> Hi Denys
>
> I checked before and iproute2 works just fine. The code is a bit different:
Friendly ping.
Regards,
yousong
>
> >
> > iproute.c
> > static int filter_nlmsg(struct nlmsghdr *n, struct rtattr **tb, int host_len)
> > {
> > struct rtmsg *r = NLMSG_DATA(n);
> > inet_prefix dst = { .family = r->rtm_family };
> > inet_prefix src = { .family = r->rtm_family };
> > inet_prefix via = { .family = r->rtm_family };
> > inet_prefix prefsrc = { .family = r->rtm_family };
> > __u32 table;
> > static int ip6_multiple_tables;
> >
> > table = rtm_get_table(r, tb);
> >
> > if (preferred_family != AF_UNSPEC && r->rtm_family != preferred_family)
> > return 0;
> >
> > if (r->rtm_family == AF_INET6 && table != RT_TABLE_MAIN)
> > ip6_multiple_tables = 1;
>
> It sets ip6_multiple_tables here.
>
> >
> > if (filter.cloned == !(r->rtm_flags & RTM_F_CLONED))
> > return 0;
> >
> > if (r->rtm_family == AF_INET6 && !ip6_multiple_tables) {
>
> So it won't go into this branch
>
> > if (filter.tb) {
> > if (filter.tb == RT_TABLE_LOCAL) {
> > if (r->rtm_type != RTN_LOCAL)
> > return 0;
> > } else if (filter.tb == RT_TABLE_MAIN) {
> > if (r->rtm_type == RTN_LOCAL)
> > return 0;
> > } else {
> > return 0;
> > }
> > }
> > } else {
> > if (filter.tb > 0 && filter.tb != table)
> > return 0;
>
> The check happens here.
>
> Regards,
> yousong
>
> > }
_______________________________________________
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic