2010/3/30 Maxim Kryžanovský <[email protected]>: > 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 [email protected] http://lists.busybox.net/mailman/listinfo/busybox
