[prev in list] [next in list] [prev in thread] [next in thread] 

List:       busybox
Subject:    Re: [PATCH] ifplugd
From:       Denys Vlasenko <vda.linux () googlemail ! com>
Date:       2010-03-30 13:51:05
Message-ID: 1158166a1003300651j6813d1c4p763eb119607f561b () mail ! gmail ! com
[Download RAW message or body]

2010/3/30 Maxim Kryžanovský <xmaks@email.cz>:
> Hi Denis,
> 
> i want to thank for the ifplugd code review! I think I'm one step further with the \
> busybox's philosophy. 
> I have written up a short summary explaining the code differences between \
> implementations. Also can we remove some dead/redundant code from the \
> 'check_existence_through_netlink' function? For example: 
> //linux/netlink.h
> //#define NLMSG_OK(nlh,len) ((len) >= (int)sizeof(struct nlmsghdr) && \
> //   (nlh)->nlmsg_len >= sizeof(struct nlmsghdr) && \
> //   (nlh)->nlmsg_len <= (len))
> if (!NLMSG_OK(mhdr, bytes)
> > > bytes < sizeof(struct nlmsghdr) || bytes < mhdr->nlmsg_len // as NLMSG_OK is \
> > > declared, with short-cut evaluation its never be performed
> ) {
> ...
> }
> 
> Attached is a patch.

Applied, thanks!


Is this safe?

if (strncmp(G.iface, RTA_DATA(attr), len) == 0)

What if RTA_DATA(attr) = "if", len = 2, and G.iface = "if0"?
Or does kernel pass attr with NUL included?

-- 
vda
_______________________________________________
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