libnl/lib
chantra 8a4f16b5bf Call to_msg_fill_raw when defined to_msg_fill is NULL
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@testbox libnl]# NLCB=debug ./netem
-- Debug: Sent Message:
--------------------------   BEGIN NETLINK MESSAGE ---------------------------
  [NETLINK HEADER] 16 octets
    .nlmsg_len = 48
    .type = 36 <route/qdisc::new>
    .flags = 1029 <REQUEST,ACK,ATOMIC>
    .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 <ERROR>
    .flags = 0 <>
    .seq = 1376894544
    .port = 17877
  [ERRORMSG] 20 octets
    .error = -22 "Invalid argument"
  [ORIGINAL MESSAGE] 16 octets
    .nlmsg_len = 16
    .type = 36 <0x24>
    .flags = 1029 <REQUEST,ACK,ATOMIC>
    .seq = 1376894544
    .port = 17877
---------------------------  END NETLINK MESSAGE ---------------------------
-- Error received: Invalid argument
-- Original message: type=0x24 length=48 flags=<REQUEST,ACK,ATOMIC>
sequence-nr=1376894544 pid=17877
RC -7
[root@testbox libnl]# NLCB=debug ./netem
-- Debug: Sent Message:
--------------------------   BEGIN NETLINK MESSAGE ---------------------------
  [NETLINK HEADER] 16 octets
    .nlmsg_len = 76
    .type = 36 <route/qdisc::new>
    .flags = 1029 <REQUEST,ACK,ATOMIC>
    .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 <ERROR>
    .flags = 0 <>
    .seq = 1376895147
    .port = 26541
  [ERRORMSG] 20 octets
    .error = 0 "Success"
  [ORIGINAL MESSAGE] 16 octets
    .nlmsg_len = 16
    .type = 36 <0x24>
    .flags = 1029 <REQUEST,ACK,ATOMIC>
    .seq = 1376895147
    .port = 26541
---------------------------  END NETLINK MESSAGE  ---------------------------
RC 0
[root@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

Signed-off-by: chantra <chantra@fb.com>
Signed-off-by: Thomas Graf <tgraf@suug.ch>
2013-08-26 10:11:12 +02:00
..
cli Support plug qdisc - queue traffic until explicit release 2012-02-14 12:02:04 +01:00
fib_lookup Use thread-safe strerror_r() instead of strerror() 2013-02-28 13:07:04 +01:00
genl genl: Fix cb reference leak in genl_ctrl_probe_by_name() 2013-04-02 11:51:53 +02:00
idiag More safely parse vegas info and mem info. 2013-07-25 17:59:56 -07:00
netfilter netfilter/queue: introduce nfnl_queue_msg_send_verdict_batch() 2013-06-27 01:16:15 +02:00
route Call to_msg_fill_raw when defined to_msg_fill is NULL 2013-08-26 10:11:12 +02:00
.gitignore Added lex.yy.c to .gitignore 2012-08-30 03:19:04 +06:00
addr.c addr: only translate more recent address family names and ARP types if defined 2013-04-05 10:37:55 +02:00
attr.c Wrong calcultation in nla_reserve 2013-04-28 10:34:50 +02:00
cache.c cache: Return -NLE_PROTO_MISMATCH if socket provided mismatches cache protocol 2013-07-01 12:41:42 +02:00
cache_mngr.c Handle -NLE_AGAIN in nl_cache_mngr_data_ready 2013-06-27 01:12:36 +02:00
cache_mngt.c Move private header files to <netlink-private/*> 2013-01-24 13:51:24 +01:00
data.c Move private header files to <netlink-private/*> 2013-01-24 13:51:24 +01:00
error.c Move private header files to <netlink-private/*> 2013-01-24 13:51:24 +01:00
handlers.c Use thread-safe strerror_r() instead of strerror() 2013-02-28 13:07:04 +01:00
hash.c Hash: Properly prefix hash functions 2012-11-10 10:22:26 +01:00
hashtable.c Move private header files to <netlink-private/*> 2013-01-24 13:51:24 +01:00
Makefile.am Enable linker versioning 2013-08-07 14:51:03 +02:00
msg.c msg: Avoid returning a negative value for nlmsg_attrlen() 2013-06-27 18:29:17 +02:00
nl.c nl: Increase receive buffer size to 4 pages 2013-05-08 13:52:27 +02:00
object.c Default to comparing all attributes if no oo_id_attrs defined 2013-06-27 01:12:28 +02:00
socket.c socket: Warn via debug message if local port namespace is exhausted 2013-06-28 18:53:16 +02:00
utils.c Handle the case where nl_msec2str is passed 0 msecs 2013-07-19 02:06:27 -07:00
version.c Run-time version information is now available 2012-08-30 03:19:04 +06:00