mailing list of musl libc
 help / color / mirror / code / Atom feed
4270872281206fd801f3cb8edcaca59d1379627c blob 534 bytes (raw)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
 
#include <stdlib.h>
#include <netinet/ether.h>

static struct ether_addr a;

struct ether_addr *ether_aton_r (const char *x, struct ether_addr *p_a) {
	for (int ii = 0; ii < 6; ii++) {
		unsigned long int n;
		if (ii != 0) {
			if (x[0] != ':') return 0; /* bad format */
			else x++;
		}
		n = strtoul (x, &x, 16);
		if (n > 0xFF) return 0; /* bad byte */
		(*p_a).ether_addr_octet[ii] = n;
	}
	if (x[0] != 0) return 0; /* bad format */
	return p_a;
}

struct ether_addr *ether_aton (const char *x) {
	return ether_aton_r (x, &a);
}
debug log:

solving 4270872 ...
found 4270872 in https://inbox.vuxu.org/musl/CAL3m8eCcZkn2YDAHyf1Ns4a4Zcz0Mk3ENrdby8tarCoKEc+qkw@mail.gmail.com/ ||
	https://inbox.vuxu.org/musl/CAL3m8eCdz_eUGptYsn5NDPho0PQ_=wH+F4aY9eSmgsPj+vS00w@mail.gmail.com/

applying [1/2] https://inbox.vuxu.org/musl/CAL3m8eCcZkn2YDAHyf1Ns4a4Zcz0Mk3ENrdby8tarCoKEc+qkw@mail.gmail.com/
diff --git a/src/network/ether_aton.c b/src/network/ether_aton.c
new file mode 100644
index 0000000..4270872

Checking patch src/network/ether_aton.c...
Applied patch src/network/ether_aton.c cleanly.

skipping https://inbox.vuxu.org/musl/CAL3m8eCdz_eUGptYsn5NDPho0PQ_=wH+F4aY9eSmgsPj+vS00w@mail.gmail.com/ for 4270872
index at:
100644 4270872281206fd801f3cb8edcaca59d1379627c	src/network/ether_aton.c

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).