4ff86df861
A padding to align a message should not only be added between different attributes of a netlink message, but also at the end of the message to pad it to the correct size. Without this patch the following command does not work and returns an error code: ip link add type nlmon Without this ip from busybox sends this: sendmsg(3, {msg_name={sa_family=AF_NETLINK, nl_pid=0, nl_groups=00000000}, msg_namelen=12, msg_iov=[{iov_base={{len=45, ...}, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\20\0\22\0\t\0\1nlmon"}, iov_len=45}], msg_iovlen=1, msg_controllen=0, msg_flags=0}, 0) = 45 return value: 2 The normal ip utile from iproute2 sends this: sendmsg(3, {msg_name={sa_family=AF_NETLINK, nl_pid=0, nl_groups=00000000}, msg_namelen=12, msg_iov=[{iov_base={{len=48, ...}, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\20\0\22\0\t\0\1nlmon\0\0\0"}, iov_len=48}], msg_iovlen=1, msg_controllen=0, msg_flags=0}, 0) = 48 return value: 0 With this patch ip from busybox sends this: sendmsg(3, {msg_name={sa_family=AF_NETLINK, nl_pid=0, nl_groups=00000000}, msg_namelen=12, msg_iov=[{iov_base={{len=48, ...}, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\20\0\22\0\t\0\1nlmon\0\0\0"}, iov_len=48}], msg_iovlen=1, msg_controllen=0, msg_flags=0}, 0) = 48 return value: 0 Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com> |
||
---|---|---|
.. | ||
libiproute | ||
ssl_helper | ||
ssl_helper-wolfssl | ||
udhcp | ||
arp.c | ||
arping.c | ||
brctl.c | ||
Config.src | ||
dnsd.c | ||
ether-wake.c | ||
ftpd.c | ||
ftpgetput.c | ||
hostname.c | ||
httpd_indexcgi.c | ||
httpd_post_upload.txt | ||
httpd_ssi.c | ||
httpd.c | ||
ifconfig.c | ||
ifenslave.c | ||
ifplugd.c | ||
ifupdown.c | ||
inetd.c | ||
interface.c | ||
ip.c | ||
ipcalc.c | ||
isrv_identd.c | ||
isrv.c | ||
isrv.h | ||
Kbuild.src | ||
nameif.c | ||
nbd-client.c | ||
nc_bloaty.c | ||
nc.c | ||
netstat.c | ||
nslookup.c | ||
ntpd.c | ||
ntpd.diff | ||
ping.c | ||
pscan.c | ||
route.c | ||
slattach.c | ||
tc.c | ||
tcpudp_perhost.c | ||
tcpudp_perhost.h | ||
tcpudp.c | ||
telnet.c | ||
telnetd.c | ||
telnetd.ctrlSQ.patch | ||
tftp.c | ||
traceroute.c | ||
tunctl.c | ||
vconfig.c | ||
wget.c | ||
whois.c | ||
zcip.c |