Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PPPoE, ARCnet, DECnet and MTP3 assorted improvements #1449

Merged
merged 11 commits into from
Jan 31, 2025
Merged
17 changes: 3 additions & 14 deletions etherent.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
#include <string.h>

#include "pcap-int.h"
#include "nametoaddr.h"

#include <pcap/namedb.h>

Expand All @@ -40,18 +41,6 @@
static inline int skip_space(FILE *);
static inline int skip_line(FILE *);

/* Hex digit to integer. */
static inline u_char
xdtoi(u_char c)
{
if (c >= '0' && c <= '9')
return (u_char)(c - '0');
else if (c >= 'a' && c <= 'f')
return (u_char)(c - 'a' + 10);
else
return (u_char)(c - 'A' + 10);
}

/*
* Skip linear white space (space and tab) and any CRs before LF.
* Stop when we hit a non-white-space character or an end-of-line LF.
Expand Down Expand Up @@ -109,13 +98,13 @@ pcap_next_etherent(FILE *fp)

/* must be the start of an address */
for (i = 0; i < 6; i += 1) {
d = xdtoi((u_char)c);
d = pcapint_xdtoi((u_char)c);
c = getc(fp);
if (c == EOF)
return (NULL);
if (PCAP_ISXDIGIT(c)) {
d <<= 4;
d |= xdtoi((u_char)c);
d |= pcapint_xdtoi((u_char)c);
c = getc(fp);
if (c == EOF)
return (NULL);
Expand Down
Loading