[PATCH 00/26] Implemented basic protocol specific decoding of NETLINK_ROUTE

Dmitry V. Levin ldv at altlinux.org
Sat Aug 12 15:53:37 UTC 2017


On Sat, Aug 12, 2017 at 11:32:57PM +0800, JingPiao Chen wrote:
> On Sat, Aug 12, 2017 at 03:22:24AM +0300, Dmitry V. Levin wrote:
> > On Thu, Aug 10, 2017 at 09:03:22AM +0800, JingPiao Chen wrote:
> > > Note:
> > > 
> > > rule:
> > > Before v2.6.18-284-g14c0b97, rule carry struct rtmsg,
> > > now carry struct fib_rule_hdr.
> > > 
> > > $ man 7 rtnetlink # or read the old kernel
> > > RTM_NEWRULE, RTM_DELRULE, RTM_GETRULE
> > > 	Add, delete or retrieve a routing rule.  Carries a struct rtmsg
> > > 
> > > Read linux kernel source code
> > > linux/net/core/fib_rules.c: fib_nl_delrule(), fib_nl_delrule();
> > > know rule carry struct fib_rule_hdr.
> > 
> > struct rtmsg and struct fib_rule_hdr are essentially the same structure,
> > iproute2 uses the former.
> 
> You mean that rule header message is struct rtmsg,
> and rule netlink attribute are FRA_*?

Like iproute2, you can use struct rtmsg but treat it as
struct fib_rule_hdr: ignore rtm_protocol and rtm_scope fields,
treat rtmsg.rtm_type as fib_rule_hdr.action, and parse FRA_* attributes.


-- 
ldv
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: not available
URL: <http://lists.strace.io/pipermail/strace-devel/attachments/20170812/0fc6d742/attachment.bin>


More information about the Strace-devel mailing list