Skip to content

dlpi: Replace magic number with named constant #1535

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

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion pcap-dlpi.c
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,12 @@

#define MAXDLBUF 8192

/*
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As this is only used for HP-UX, should it be defined inside an #ifdef for HP-UX?

* Maximum number of outstanding connection indication messages for DLPI.
* For libpcap packet capture, we use 1 since we only need simple capture.
*/
#define DLPI_MAX_CONIND 1

/* Forwards */
static char *split_dname(char *, u_int *, char *);
static int dl_doattach(int, int, char *);
Expand Down Expand Up @@ -1454,7 +1460,7 @@ dlbindreq(int fd, bpf_u_int32 sap, char *ebuf)
req.dl_primitive = DL_BIND_REQ;
/* XXX - what if neither of these are defined? */
#if defined(DL_HP_RAWDLS)
req.dl_max_conind = 1; /* XXX magic number */
req.dl_max_conind = DLPI_MAX_CONIND;
req.dl_service_mode = DL_HP_RAWDLS;
#elif defined(DL_CLDLS)
req.dl_service_mode = DL_CLDLS;
Expand Down