|
Message-ID: <50834888.5020109@barfooze.de> Date: Sun, 21 Oct 2012 02:57:44 +0200 From: John Spencer <maillist-musl@...fooze.de> To: musl@...ts.openwall.com Subject: Re: [PATCH 3/4] Import BSD functions defined in <netinet/ether.h> from NetBSD On 10/21/2012 02:52 AM, Abdoulaye Walsimou GAYE wrote: > On 10/21/2012 02:42 AM, John Spencer wrote: >> On 10/20/2012 10:15 PM, Abdoulaye Walsimou Gaye wrote: >>> +/* >>> + * ether_aton(): >>> + * This function converts an ASCII string of the same form and to a >>> structure >>> + * containing the 6 octets of the address. It returns a pointer to a >>> + * static structure that is reused for each call. >>> + */ >>> +struct ether_addr *ether_aton(const char *s) >>> +{ >>> + static struct ether_addr n; >>> + unsigned int i[6]; >>> + >>> + assert(s != NULL); >>> + >>> + if (sscanf(s, " %x:%x:%x:%x:%x:%x ",&i[0],&i[1], >>> + &i[2],&i[3],&i[4],&i[5]) == 6) { >>> + n.ether_addr_octet[0] = (unsigned char)i[0]; >>> + n.ether_addr_octet[1] = (unsigned char)i[1]; >>> + n.ether_addr_octet[2] = (unsigned char)i[2]; >>> + n.ether_addr_octet[3] = (unsigned char)i[3]; >>> + n.ether_addr_octet[4] = (unsigned char)i[4]; >>> + n.ether_addr_octet[5] = (unsigned char)i[5]; >>> + return&n; >>> + } >>> + return NULL; >>> +} >> >> why do you duplicate the code and not use simply the _r functions >> from [4/4] with the static buffer ? >> btw the usage of sscanf is both bloated and slow. > > This was for record of the original code from NetBSD, before patching > it in [4/4] ah... so you sent patches that undo your earlier patches. this doesnt make reviewing them simpler... why didn't you simply merge them before sending ? > >> >> anyway, i doubt it makes sense to add this crap; i never needed it >> for sabotage which is almost feature complete and compiles 250 packages. > > I can not argue with this kind of comments. with crap, i was refering to these functions, not your work. the point that i haven't needed these functions besides having wpa_supplicant, wireless-tools, iptables and nmap in the repos still stands.
Powered by blists - more mailing lists
Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.