Skip to content

Commit

Permalink
Rename activate_sock() to activate_pf_packet().
Browse files Browse the repository at this point in the history
That's the code path for activating a PF_PACKET socket.
  • Loading branch information
guyharris committed Nov 30, 2019
1 parent b7fa331 commit d3ab412
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions pcap-linux.c
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ static int get_if_flags(const char *, bpf_u_int32 *, char *);
static int is_wifi(int, const char *);
static void map_arphrd_to_dlt(pcap_t *, int, int, const char *, int);
static int pcap_activate_linux(pcap_t *);
static int activate_sock(pcap_t *, int);
static int activate_pf_packet(pcap_t *, int);
static int setup_non_mmapped(pcap_t *);
#ifdef HAVE_PACKET_RING
static int setup_mmapped(pcap_t *, int *);
Expand Down Expand Up @@ -1461,7 +1461,7 @@ pcap_activate_linux(pcap_t *handle)
* If the "any" device is specified, try to open a SOCK_DGRAM.
* Otherwise, open a SOCK_RAW.
*/
ret = activate_sock(handle, is_any_device);
ret = activate_pf_packet(handle, is_any_device);
if (ret < 0) {
/*
* Fatal error; the return value is the error code,
Expand Down Expand Up @@ -2711,7 +2711,7 @@ static void map_arphrd_to_dlt(pcap_t *handle, int sock_fd, int arptype,
* XXX - are there any other sorts of "fake Ethernet" that
* have ARPHRD_ETHER but that shouldn't offer DLT_DOCSIS as
* a Cisco CMTS won't put traffic onto it or get traffic
* bridged onto it? ISDN is handled in "activate_sock()",
* bridged onto it? ISDN is handled in "activate_pf_packet()",
* as we fall back on cooked mode there, and we use
* is_wifi() to check for 802.11 devices; are there any
* others?
Expand Down Expand Up @@ -3067,7 +3067,7 @@ static void map_arphrd_to_dlt(pcap_t *handle, int sock_fd, int arptype,
/* We need to save packet direction for IrDA decoding,
* so let's use "Linux-cooked" mode. Jean II
*
* XXX - this is handled in activate_sock(). */
* XXX - this is handled in activate_pf_packet(). */
/* handlep->cooked = 1; */
break;

Expand Down Expand Up @@ -3109,7 +3109,7 @@ static void map_arphrd_to_dlt(pcap_t *handle, int sock_fd, int arptype,
* pick up the netlink protocol type such as NETLINK_ROUTE,
* NETLINK_GENERIC, NETLINK_FIB_LOOKUP, etc.
*
* XXX - this is handled in activate_sock().
* XXX - this is handled in activate_pf_packet().
*/
/* handlep->cooked = 1; */
break;
Expand Down Expand Up @@ -3171,7 +3171,7 @@ set_dlt_list_cooked(pcap_t *handle _U_, int sock_fd _U_)
* Returns 0 on success and a PCAP_ERROR_ value on failure.
*/
static int
activate_sock(pcap_t *handle, int is_any_device)
activate_pf_packet(pcap_t *handle, int is_any_device)
{
struct pcap_linux *handlep = handle->priv;
const char *device = handle->opt.device;
Expand Down Expand Up @@ -3615,7 +3615,7 @@ setup_mmapped(pcap_t *handle, int *status)
* warnings or to a PCAP_WARNING_ value if there is a warning.
*
* Override some defaults and inherit the other fields from
* activate_sock.
* activate_pf_packet().
* handle->offset is used to get the current position into the rx ring.
* handle->cc is used to store the ring size.
*/
Expand Down

0 comments on commit d3ab412

Please sign in to comment.