summaryrefslogtreecommitdiff
path: root/package/libpcap/patches/102-alt-ether.patch
blob: 5f356ca99036c6bf5ef5ca9bd3f279426777825a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
Index: libpcap-0.9.4/nametoaddr.c
===================================================================
--- libpcap-0.9.4.orig/nametoaddr.c	2007-06-04 13:22:03.499323304 +0200
+++ libpcap-0.9.4/nametoaddr.c	2007-06-04 13:22:03.986249280 +0200
@@ -410,7 +410,7 @@
 	e = ep = (u_char *)malloc(6);
 
 	while (*s) {
-		if (*s == ':')
+		if (*s == ':' || *s == '.')
 			s += 1;
 		d = xdtoi(*s++);
 		if (isxdigit((unsigned char)*s)) {
Index: libpcap-0.9.4/scanner.l
===================================================================
--- libpcap-0.9.4.orig/scanner.l	2007-06-04 13:22:03.506322240 +0200
+++ libpcap-0.9.4/scanner.l	2007-06-04 13:22:03.987249128 +0200
@@ -80,6 +80,7 @@
 N		([0-9]+|(0X|0x)[0-9A-Fa-f]+)
 B		([0-9A-Fa-f][0-9A-Fa-f]?)
 W		([0-9A-Fa-f][0-9A-Fa-f]?[0-9A-Fa-f]?[0-9A-Fa-f]?)
+X               [0-9A-Fa-f]
 
 %a 16000
 %o 19000
@@ -306,7 +307,7 @@
 {N}			{ yylval.i = stoi((char *)yytext); return NUM; }
 ({N}\.{N})|({N}\.{N}\.{N})|({N}\.{N}\.{N}\.{N})	{
 			yylval.s = sdup((char *)yytext); return HID; }
-{B}:{B}:{B}:{B}:{B}:{B} { yylval.e = pcap_ether_aton((char *)yytext);
+({B}:{B}:{B}:{B}:{B}:{B})|({B}\.{B}\.{B}\.{B}\.{B}\.{B}) { yylval.e = pcap_ether_aton((char *)yytext);
 			  return EID; }
 {V6}			{
 #ifdef INET6
@@ -324,6 +325,7 @@
 #endif /*INET6*/
 			}
 {B}:+({B}:+)+		{ bpf_error("bogus ethernet address %s", yytext); }
+{X}{12}                        { yylval.e = pcap_ether_aton((char *)yytext); return EID;}
 icmptype		{ yylval.i = 0; return NUM; }
 icmpcode		{ yylval.i = 1; return NUM; }
 icmp-echoreply		{ yylval.i = 0; return NUM; }