[libnl] Call to_msg_fill_raw when defined to_msg_fill is NULL (#47)

Thomas Graf tgraf at redhat.com
Mon Aug 26 04:12:03 EDT 2013


On 08/25/2013 05:14 AM, chantra wrote:
> netem qdisc uses to_msg_fill_raw to build netlink packet. So far, this
> was not called from anywhere.
>
> Example creating a netem qdisc before and after the change:
>
> [root at testbox libnl]# NLCB=debug ./netem
> -- Debug: Sent Message:
> -------------------------- BEGIN NETLINK MESSAGE ---------------------------
> [NETLINK HEADER] 16 octets
> .nlmsg_len = 48
> .type = 36
> .flags = 1029
> .seq = 1376894544
> .port = 17877
> [PAYLOAD] 20 octets
> 00 00 00 00 02 00 00 00 00 00 01 80 01 00 01 00 ................
> 00 00 00 00 ....
> [ATTR 01] 6 octets
> 6e 65 74 65 6d 00 netem.
> [PADDING] 2 octets
> 00 00 ..
> --------------------------- END NETLINK MESSAGE ---------------------------
> -- Debug: Received Message:
> -------------------------- BEGIN NETLINK MESSAGE ---------------------------
> [NETLINK HEADER] 16 octets
> .nlmsg_len = 68
> .type = 2
> .flags = 0 <>
> .seq = 1376894544
> .port = 17877
> [ERRORMSG] 20 octets
> .error = -22 "Invalid argument"
> [ORIGINAL MESSAGE] 16 octets
> .nlmsg_len = 16
> .type = 36
> .flags = 1029
> .seq = 1376894544
> .port = 17877
> --------------------------- END NETLINK MESSAGE ---------------------------
> -- Error received: Invalid argument
> -- Original message: type=0x24 length=48 flags=
> sequence-nr=1376894544 pid=17877
> RC -7
> [root at testbox libnl]# NLCB=debug ./netem
> -- Debug: Sent Message:
> -------------------------- BEGIN NETLINK MESSAGE ---------------------------
> [NETLINK HEADER] 16 octets
> .nlmsg_len = 76
> .type = 36
> .flags = 1029
> .seq = 1376895147
> .port = 26541
> [PAYLOAD] 20 octets
> 00 00 00 00 02 00 00 00 00 00 01 80 01 00 01 00 ................
> 00 00 00 00 ....
> [ATTR 01] 6 octets
> 6e 65 74 65 6d 00 netem.
> [PADDING] 2 octets
> 00 00 ..
> [ATTR 02] 24 octets
> 00 00 00 00 a0 86 01 00 00 00 00 80 00 00 00 00 ................
> 00 00 00 00 00 00 00 00 ........
> --------------------------- END NETLINK MESSAGE ---------------------------
> -- Debug: Received Message:
> -------------------------- BEGIN NETLINK MESSAGE ---------------------------
> [NETLINK HEADER] 16 octets
> .nlmsg_len = 36
> .type = 2
> .flags = 0 <>
> .seq = 1376895147
> .port = 26541
> [ERRORMSG] 20 octets
> .error = 0 "Success"
> [ORIGINAL MESSAGE] 16 octets
> .nlmsg_len = 16
> .type = 36
> .flags = 1029
> .seq = 1376895147
> .port = 26541
> --------------------------- END NETLINK MESSAGE ---------------------------
> RC 0
> [root at testbox libnl]# tc qdisc show
> qdisc htb 1: dev eth0 root refcnt 2 r2q 10 default 0 direct_packets_stat
> 21115
> qdisc netem 8001: dev eth0 parent 1:1 limit 100000 loss 50%
> qdisc htb 1: dev eth1 root refcnt 2 r2q 10 default 0 direct_packets_stat 0
>
> ------------------------------------------------------------------------
>
>
>         You can merge this Pull Request by running
>
>    git pull https://github.com/chantra/libnl master
>
> Or view, comment on, or merge it at:
>
> https://github.com/tgraf/libnl/pull/47
>
>
>         Commit Summary
>
>   * Call to_msg_fill_raw when defined to_msg_fill is NULL
>
>
>         File Changes
>
>   * *M* lib/route/tc.c
>     <https://github.com/tgraf/libnl/pull/47/files#diff-0> (18)
>
>
>         Patch Links:
>
>   * https://github.com/tgraf/libnl/pull/47.patch
>   * https://github.com/tgraf/libnl/pull/47.diff
>

Applied, thanks. I fixed up some style issues by hand.




More information about the libnl mailing list