#! /bin/sh -e ## 20_mac_syntax.dpatch by Torsten Landschoff ## ## All lines beginning with `## DP:' are a description of the patch. ## DP: Adds more possible syntaxes to input MAC addresses: ## DP: - the nn.nn.nn.nn.nn.nn syntax ## DP: - the hexadecimal syntax if [ $# -lt 1 ]; then echo "`basename $0`: script expects -patch|-unpatch as argument" >&2 exit 1 fi [ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts patch_opts="${patch_opts:--f --no-backup-if-mismatch} ${2:+-d $2}" case "$1" in -patch) patch -p1 ${patch_opts} < $0;; -unpatch) patch -R -p1 ${patch_opts} < $0;; *) echo "`basename $0`: script expects -patch|-unpatch as argument" >&2 exit 1;; esac exit 0 @DPATCH@ diff -urNad /home/romain/Work/Debian/libpcap/libpcap0.8/libpcap0.8-0.8.3/nametoaddr.c libpcap0.8-0.8.3/nametoaddr.c --- /home/romain/Work/Debian/libpcap/libpcap0.8/libpcap0.8-0.8.3/nametoaddr.c 2004-04-30 15:45:14.000000000 +0200 +++ libpcap0.8-0.8.3/nametoaddr.c 2004-04-30 15:57:54.000000000 +0200 @@ -333,7 +333,7 @@ e = ep = (u_char *)malloc(6); while (*s) { - if (*s == ':') + if (*s == ':' || *s == '.') s += 1; d = xdtoi(*s++); if (isxdigit((unsigned char)*s)) { diff -urNad /home/romain/Work/Debian/libpcap/libpcap0.8/libpcap0.8-0.8.3/scanner.l libpcap0.8-0.8.3/scanner.l --- /home/romain/Work/Debian/libpcap/libpcap0.8/libpcap0.8-0.8.3/scanner.l 2004-04-30 15:45:14.000000000 +0200 +++ libpcap0.8-0.8.3/scanner.l 2004-04-30 15:57:54.000000000 +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 @@ -296,7 +297,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 @@ -314,6 +315,8 @@ #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; }