2008-07-07 17:41:48 +03:00
|
|
|
--- a/nametoaddr.c
|
|
|
|
+++ b/nametoaddr.c
|
2006-05-24 10:18:36 +03:00
|
|
|
@@ -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)) {
|
2008-07-07 17:41:48 +03:00
|
|
|
--- a/scanner.l
|
|
|
|
+++ b/scanner.l
|
2006-05-24 10:18:36 +03:00
|
|
|
@@ -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]
|
|
|
|
|
2008-07-07 17:41:48 +03:00
|
|
|
%a 18400
|
|
|
|
%o 21500
|
|
|
|
@@ -310,7 +311,7 @@
|
2006-05-24 10:18:36 +03:00
|
|
|
{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
|
2008-07-07 17:41:48 +03:00
|
|
|
@@ -328,6 +329,7 @@
|
2006-05-24 10:18:36 +03:00
|
|
|
#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; }
|